.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> WPF >> Post New QuestionBookmark and Share Subscribe to Forum

diaplaying just threecolumns out of ten..in wpd datagrid

Posted By: Jayakumar     Posted Date: April 06, 2010    Points:2   Category :WPF
hi,

i am using thro wpf datagrid with windows appl..

just i want to display only 3 columns outof ten..

i am geting extra one column as empty..

how to fill the wpf datagrid with limited columns..

regards
jai

Responses
Author: Sunil Yadav       [Moderator]      
Posted Date: May 27, 2010     Points: 5   

Hi,

Try this,

<datacontrol:DataGrid

AutoGenerateColumns="False"

ItemsSource="{Binding Customer}">

<datacontrol:DataGrid.Columns>

< datacontrol:DataGridTextColumn

Header="CustName"

Binding="{CID}"

Width="200"/>

<datacontrol:DataGridTextColumn

Header="Cust Name"

Binding="{Binding CustName}"

Width="200"/>

</ datacontrol:DataGrid.Columns>

<datacontrol:DataGridTextColumn

Header="Address"

Binding="{Binding Address}"

Width="200"/>

</ datacontrol:DataGrid.Columns>

</ datacontrol:DataGrid>




Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend