Jump to content

Gridview Controls


soona

Recommended Posts

Hi,I am using asp.net2.0 with c# language.My doubts in GridView control.when i select three items at same time from categories(Fruits, Apples, Gifts). The selected items are displayed in gridview.Here i would like to change this "when i click more than one category at same time. it should be display selected item and button."For example: if i have to select Fruits, Apples from categories. it should be display like 1st "row have Fruits and In 2nd row have Apples and button" in gridview.the button have some event.How can i do it? Please can anyone answer me.With kind requestThanks

Link to comment
Share on other sites

Well Friend you can use GridView's DataBound Event and RowCommand Eventin GridView's DataBound Event U can run a loop as following:foreach(GridViewRow row in GridView1.Rows){ //Here U can get each row individually.. //e.g. If there is a button in first column of GridView so we can access it as following... Button btn=(Button)row.Cells[0].Controls[0]; //Now you can access and change properties of Button Control... btn.Text="Edit"; //or whatever the need is... //To access a cell value from GridView, u can do it as: string strCellValue=row.Cells[3].Text;}Infact U must clarify what Ur need is I hope what I've elaborated will work for U...

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...