How do you customize the column content inside the datagrid?
Answers were Sorted based on User's Feedback
Answer / bhanu
1.Right click on the datagrid
2.click property builder
3.A datagrid properties window is opened.u will find few
options on left side like general,column,paging,format.
4.double click on coloumn u will get boundcolumn,button
coloumn ,hyperlink column,template coloumn.
5.right click on template column of datagrid u will get
edit template and go for coloumn(0).
6. drag & drop the control from the toolbox u needed in
edit template.
| Is This Answer Correct ? | 1 Yes | 1 No |
Answer / ashutosh rai
We will add a function signature of OnItemDataBind in
DataGrid or by creating an event handler in code file for
DataGrid Binding. Now in the definition of function we will
check that is DataGrid Item type is of ListItemType or
AlternatingItemType then we will costomize the column by
setting the property of particular column in code window.
for eg.
event handler of funcion:
this.DataGrid.ItemDataBound += new
system.Web.UI.WebControls.DataGridItemEventHandler(this.DataGrid_ItemDataBound);
definition of function:
private void DataGrid_ItemDataBound(object sender,
DataGridItemEventArgs e)
{
if (e.Item.ItemType ==
ListItemType.Item || e.Item.ItemType ==
ListItemType.AlternatingItem)
{
e.Item.Cells[1].Font.Bold;
}
}
| Is This Answer Correct ? | 0 Yes | 0 No |
What is a fillable form?
Name the template that is used to create a user-defined component.
Name the method that has to be overridden to change the appearance of the control that is inherited from an existing control.
If you are calling three SPs from a window application how do u check for the performance of the SPS ?
1 Answers Accenture, BirlaSoft,
Explain the new events in textbox that has been included in vb?
What is the difference between desktop application and windows application?
what are the differences between image and picture controls?
What are different authentication types. How do you retrieve user id in case of windows authentication?
Which template creates a .net compact framework 2.0 forms application for pocket pc 2003 and later?
How many navigational features are provided by visual studio.net ide?
Name the property which of menu cannot be set at run time?
how can u split a column header in gridview using C#.net