Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

How do you customize the column content inside the datagrid?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain how to net forms the windows?

973


Which property value of the helpnavigator property will display the index for a specified topic?

947


How many navigational features are provided by visual studio.net ide?

990


Name the property which is used to lock a textbox to enter data?

1025


What are the advantages of form?

904


What is a windows form application?

927


What are controls in windows forms?

923


What is a windows based application?

926


How to get records from a database?

981


What are the three states set in a checkstate property?

914


What is the extension of a compiled help project file?

1063


Explain how to get records from a database?

1048


How to split a column header in gridview using c#.net?

1169


How can you pause a timer control?

1006


Which method of the messagebox class is used to display a message in the message box?

943