.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 >> Interview Question >> Silverlight >> Post New Question Subscribe to Interview Questions

How to hide column/columns of silverlight/WPF datagrid?

Posted By :Subhransu Sekhar Jena     Posted Date :September 26, 2014    Points :40   Category :Silverlight 
If you want to hide column or columns in datagrid in code behind then do the following steps:

dgSample.Columns[0].Visibility = Visibility.Hidden;

Note: Rename dgSample to your datagrid name.


You can also find related Interview Question to How to hide column/columns of silverlight/WPF datagrid?  below: 

How you will Hide Column(s) in the Windows Forms DataGridView Control?

  
Set the DataGridViewColumn.Visible property to false.

vb.net:
-------
dataGridView1.Columns("CustomerID").Visible = False

c#.net:
------
dataGridView1.Columns["CustomerID"].Visible = False; (More...)

How do you hide the columns of a gridview?

  
By setting a column's Visible property of a column as false or by the style display:none property. (More...)

Name the types of Columns that are available in WPF DataGrid?

  
1) DataGridTextColumn
2) DataGridCheckBoxColumn
3) DataGridComboBoxColumn
4) DataGridHyperlinkColumn
5) DataGridTemplateColumn
(More...)

Will COUNT(column) include columns with null values in its count?

  
Yes, COUNT(column) include columns with null values in its count? (More...)

Difference between DataGrid, DataLsit and Repeater?

  
Difference between DataGrid, DataLsit and Repeater?

DataGrid:

1) DataGird has a in-built Support for Sort, Filter, and Paging the Data.

2) Each Row in DataGrid is displayed as a row in the table.

3) It has an AutoGenarateColumn Property, which can be set to either True or False.
Default property is true.

4) DataGrid has predefined Editing Controls.

5)Following are the DataGrid Data Control Styles:

i. AlternatingItemStyle
ii. EditItemStyle
iii. FooterStyle
iv. HeaderStyle
v. ItemStyle
vi. SelectedItemStyle
vii. PagerStyle

6) Following are the DataGrid Data Control Templates(only supported by the TemplateColumna) :

i. HeaderTemplate
ii. ItemTemplate
iii. EditItemTemplate
iv. FooterTemplate (More...)

What's difference between Datagrid, Datalist and repeater ?

  
A Datagrid, Datalist and Repeater are all ASP.NET data Web controls.

They have many things in common like DataSource Property, DataBind Method ItemDataBound and ItemCreated.

When you assign the DataSource Property of a Datagrid to a DataSet then each DataRow present in the DataRow Collection of DataTable is assigned to a corresponding DataGridItem and this is same for the rest of the two controls also. But The HTML code generated for a Datagrid has an HTML TABLE element created for the particular DataRow and its a Table form representation with Columns and Rows.

For a Datalist it''''s an Array of Rows and based on the Template Selected and the RepeatColumn Property value We can specify how many DataSource records should appear per HTML row. In hort in datagrid we have one record per row, but in datalist we can have five or six rows per row.

For a Repeater Control, the Datarecords to be displayed depends upon the Templates specified and the only HTML generated is the due to the Templates.

In addition to these, Datagrid has a in-built support for Sort, Filter and paging the Data, which is not possible when using a DataList and for a Repeater Control we would require to write an explicit code to do paging. (More...)

How to decide on the design consideration to take a Datagrid, datalist or repeater ?

  
Many make a blind choice of choosing datagrid directly, but that's not the right way.

Datagrid provides ability to allow the end-user to sort, page, and edit its data. But it comes at a cost of speed. Second the display format is simple that is in row and columns. Real life scenarios can be more demanding that

With its templates, the DataList provides more control over the look and feel of the displayed data than the DataGrid.

It offers better performance than datagrid Repeater control allows for complete and total control. With the Repeater, the only HTML emitted are the values of the databinding statements in the templates along with the HTML markup specified in the templates-no "extra" HTML is emitted, as with the DataGrid and DataList. By requiring the developer to specify the complete generated HTML markup, the Repeater often requires the longest development time. But repeater does not provide editing features like datagrid so everything has to be coded by programmer. However, the Repeater does boast the best performance of the three data Web controls. Repeater is fastest followed by Datalist and finally datagrid. (More...)

What is the best place to start Silverlight application?

  
There is no hard and fast rule to start Silverlight application. Every developer can start as per his/her experience.
like as per my case I always prefer Visual Studio. SO, in my view Visual Studio is the best place to start with Silverlight2 applications.Microsoft provides
templates for creating Silverlight applications and libraries in C#
and Visual Basic. (More...)

Can you elaborate how to start a silverlight application with Visual Studio?

  
You can find a fully described article from http://www.silverlightclub.com/resources/1858-silverlight-lets-start-building-applications.aspx.aspx
In the following step(s) I am giving the ideas all about:
1.Create a project:Here you just start your visual studio, Select your programming language [C#/VB], Choose Silverligh Template give the name and save it
2. Adding SIlverlight COntrols:One thing is happened here, controls cannot dragged onto the designer, you can draw/drag the controls on XAML page.
(a) Naming to control:In this step just give the name to your silverligt control like for Button you can give name as : btnmySilverligtButton
(b)Adding event handlers to Silverlight controls:Here you can give the event handlers like for click etc.
(c)Testing Silverlight applications in Visual Studio:Now just press F5 and test your application (More...)

What happened when I press F5 within Visual Studio to run Silverlight application?

  
When you run the Silverlight application within Visual Studio, a new folder created in the web-site project for silverlight solution and it happened only first time. The folder name is ClientBin and having package with XAP extension which contains compiled project. (More...)

How does Silverlight 2 differ from Adobe Flash?

  
As I am from .Net background so in my views you can get C# / Vb.net compiled code but in Flash there is only action script.
You can find difference in depth at : http://silverlight.net/forums/t/3015.aspx (More...)

Quick Links For Interview Questions Categories:
ASP.Net Windows Application   .NET Framework   C#   VB.Net   ADO.Net  
Sql Server   SharePoint   Silverlight   OOPs   JQuery   JavaScript/VBScript
Biztalk Patten/Practices .IIS WCF WPF WWF
Networking Aptitude Others   All      

Find questions, FAQ's and their answers related to .NET, C#, Vb.Net, Sql Server and many more.

 
Now you can find lots of .NET, C#, Vb.Net, SQL Server,Windows, ASP.Net related Questions and their Answers here at www.dotnetspark.com. Our aim is to help you pass your certification Exams (MCP, MCSD, MCAD etc.,) with flying scores and get good name in your company.

So, Start looking our Interview Question section daily and improve your .NET Skills. You can also help others by posting Interview Questions and their Answers in this section.


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