Continuation of Datagrid code

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

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=
"gridedit_PageIndexChanged"
OnUpdateCommand="updategrid_UpdateCommand"
Height="267px" PageSize=5 AllowPaging="true"
OnDeleteCommand="gridedit_DeleteCommand"
AutoGenerateColumns="false"
SelectedItemStyle-Width="100px">


I am using asp.net 2.0 version. and visualstudio.net 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.




Responses

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

Up
0
Down
Hi,
check the following link
http://www.dotnetspark.com/kb/643-how-to-editupdatedelete-gridview.aspx

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

Up
0
Down
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

http://www.dotnetfunda.com/articles/article307-paging-without-a-wizard-sqldatasource-control-in-aspnet-.aspx

Check at the bottom of this article.


Thank you for posting at Dotnetfunda

Vuyiswa Maseko

Thank you for posting at Dotnetfunda
[Administrator]

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

Login to post response