Getting gridview column values by selecting checkboxes

Posted by Jyothika07 under C# on 2/8/2011 | Points: 10 | Views : 5974 | Status : [Member] | Replies : 4
Hi

I want code for how to get gridview selected column values by selecting checkboxes using c#.net .Can anyone help me on this Thanks in advance.

Thanks,
-Jyothika




Responses

Posted by: Naimishforu on: 2/8/2011 [Member] [MVP] Bronze | Points: 25

Up
0
Down
A demo example I have given as below, please be more specific for what you are trying to achieve if you want more detail.

Label lbl = (Label)GridView1.SelectedRow.FindControl("Label1") ;

string str = lbl.Text;


Thanks,
Naimish
http://dotnetinterview.zxq.net/
http://naimishpandya.blogspot.in/

Jyothika07, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Prabhakar on: 2/8/2011 [Member] [MVP] Starter | Points: 25

Up
0
Down
Hi Jyothika07

u write code in Girdivew SelectIndexChangedEvent on CheckBox Click on Select Button

protected void gvarticle_SelectedIndexChanged(object sender, EventArgs e)
{
GridViewRow row = gvarticle.SelectedRow;
lblano.Text = row.Cells[0].Text;

}

Best Regard's
Prabhakar

Jyothika07, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Karthikanbarasan on: 2/8/2011 [Member] [Moderator] [Microsoft_MVP] [MVP] Silver | Points: 25

Up
0
Down
Hi,

If you want to select the row try this

void myGridView_SelectedIndexChanged(object sender, EventArgs e)
{
string selectedCategory = myGridView.SelectedRow.Cells[1].Text;
}



Thanks
Karthik
www.f5Debug.net

Jyothika07, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Tripati.patro on: 2/18/2011 [Member] Starter | Points: 25

Up
0
Down
Do you want to get the cell values of check box column type? Can you please make your question little bit more clear.

B.Tripati Patro
Oracle Certified Associate

Jyothika07, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response