Continuation of Datagrid code

Posted by Gayathri under ASP.NET on 4/2/2010 | Views : 914 | Status : [Member] | Replies : 2

Thank you very much. this turned out to be pretty simple.

But since i donot remember correctly, i have few more doubts in this.

i was going across few more examples from net they have mentioned as below

<asp:DataGrid ID="gridedit" runat="server" Width="100px"
DataKeyField="id" BorderStyle="Ridge" GridLines="None"
BorderWidth="2px" BorderColor="White" BackColor="White"
CellPadding="3" CellSpacing="1" AllowSorting="True"
PagerStyle-HorizontalAlign="Center" HorizontalAlign="Left"
OnEditCommand="editgrid_click" OnCancelCommand=
"gridcancel_click" OnPageIndexChanged=
Height="267px" PageSize=5 AllowPaging="true"

I am using 2.0 version. and 2005.
as i don ot get those events in my example, i am perplexed.

kindly help.
also i was able to find that
protected void editgrid_click(object sender, GridViewEditEventArgs e) appears in my code when in the sample code
it is DataGridCommandEventArgs.

I am thinking must be the version difference. Is it so?
sorry for a long doubt.


Posted by: Syedshakeer on: 4/2/2010 [Member] Starter

check the following link

Syed Shakeer Hussain

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

Posted by: Vuyiswamb on: 4/2/2010 [Member] [MVP] [Administrator] NotApplicable

The events are not automatically created. Right Click on your grid and go to Properties. In the Properties look for a sign that looks like a lightnign and click on it , it will show you the available events and double click on the white part and it will create an event handler code for you then you can add your code there, i have explained on how to do this in this article

Check at the bottom of this article.

Thank you for posting at Dotnetfunda

Vuyiswa Maseko

Thank you for posting at Dotnetfunda

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

Login to post response