Grid View Event..
-
i am working in a window Application and using a Gridview.In this gridview i am adding a button but can't find Button_Click Event... Plz Dont tell me about Cell_click Event.Its Not working Properly... Need A Help.. Thanks
-
i am working in a window Application and using a Gridview.In this gridview i am adding a button but can't find Button_Click Event... Plz Dont tell me about Cell_click Event.Its Not working Properly... Need A Help.. Thanks
You say you are working in a Windows application - I presume you mean a winforms application, there is no GridView in winforms. If you are working on a webform then you will get a better response in the ASP forum. The event I get for a DataGridView button on the other had is
private void dgData_CellContentClick(object sender, DataGridViewCellEventArgs e)
{}
Never underestimate the power of human stupidity RAH
-
You say you are working in a Windows application - I presume you mean a winforms application, there is no GridView in winforms. If you are working on a webform then you will get a better response in the ASP forum. The event I get for a DataGridView button on the other had is
private void dgData_CellContentClick(object sender, DataGridViewCellEventArgs e)
{}
Never underestimate the power of human stupidity RAH
-
i am working in a window Application and using a Gridview.In this gridview i am adding a button but can't find Button_Click Event... Plz Dont tell me about Cell_click Event.Its Not working Properly... Need A Help.. Thanks
CellContentClick is the event by which u can handle the click events of button. Just add buttons at design time using smart tag that u know. In eventHandler give MassageBox.Show("Ok"); On Clicking button in datagridview u will see this msg.
-
CellContentClick is the event by which u can handle the click events of button. Just add buttons at design time using smart tag that u know. In eventHandler give MassageBox.Show("Ok"); On Clicking button in datagridview u will see this msg.
-
ok thats right...but cellcontent_click event is fired when u click the header of the datagridview...then its a problem...
So inspect the event arguments (e) to determine who clicked it.
Never underestimate the power of human stupidity RAH
-
ok thats right...but cellcontent_click event is fired when u click the header of the datagridview...then its a problem...
No. Its not. You will get the event on clicking control that u have added(like as checkbox,button,combobox etc.). Just cross check... It works properly. :)
-
i am working in a window Application and using a Gridview.In this gridview i am adding a button but can't find Button_Click Event... Plz Dont tell me about Cell_click Event.Its Not working Properly... Need A Help.. Thanks
Please take a look at this reply to a similar question in the VB forum. RE-How-can-i-get-this-checkbox-to-work-when-it-is-selected.aspx[^] As it is in the VB forum it is in VB.Net but you should be able to follow well enough to convert it into C# Hope this helps. :)
Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”
-
i am working in a window Application and using a Gridview.In this gridview i am adding a button but can't find Button_Click Event... Plz Dont tell me about Cell_click Event.Its Not working Properly... Need A Help.. Thanks
Use the "CommandName" property of the Button and set it to What ever name you want to give and the "CommandArgument" property to the unique id of that row to get the same. You can catch the same in the RowCommand Event of the Gridview as
if (e.CommandName == "WhatEverYouNamed")
{
// Your Set of Commands and you can get the Unique Key value using e.CommandArgument.
}Using this you can have multiple buttons doing multiple things in one gridview. Regards, Kaushal Arora Please Mark as Answer if it solved your problem.