473,785 Members | 2,919 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Help with finding datagrid and associating event

I have a page with many controls. Among these controls there is a table
which is a datagrid with nested repeater inside. My problem is that I can
not use DataGridCommand EventArgs to get datagrid elements because submit
button is not in datagrid and uses onClick event btnSaveServiceP lanUpdate.
Here is the code:

Sub btnSaveServiceP lanUpdate_OnCli ck(sender As Object, e As EventArgs)
' need to get the key value serviceplanprog ram_id and other elements of
datagrid here
.....
Response.Write( "<br>Progra m id: " & intProgramID)
Response.Write( "<br>Notes: " & Request.Form("t xtNotes"))
.....
End Sub
<asp:table id="tClientNote " runat="server" CellPadding="3" CellSpacing="0" >
<asp:tablerow runat="server">
<asp:tablecel l runat="server">
.....
<asp:tablerow runat="server">
<asp:tablecel l runat="server"> Notes</asp:tablecell>
<asp:tablecel l runat="server"> <ASP:TextBox id="txtNotes" runat="server"
Text="" TextMode="Multi line" Columns="40" Rows="4" /></asp:tablecell>
</asp:tablerow>
<asp:tablerow runat="server">
<asp:tablecel l runat="server"> Added By</asp:tablecell>
<asp:tablecel l runat="server"> <asp:label id="lblAdded_by " Text=""
runat="server" /></asp:tablecell>
</asp:tablerow>
....
<asp:tablerow runat="server">
<asp:tablecel l columnspan="2" runat="server">
<ASP:DataGrid id="dgrdCurrent ServicePlanProg rams" RunAt="Server"
Width="800" BorderWidth="0" CellPadding="3" CellSpacing="0"
HeaderStyle-BackColor="#F6F 6F6"
AlternatingItem Style-BackColor="Alic eBlue"
AutoGenerateCol umns="False" DataKeyField="s erviceplanprogr am_id"
AllowPaging="Fa lse"
OnItemCommand=" Grid_CurrentSer vicePlanProgram Command"

<ItemStyle VerticalAlign=" top" />
<Columns>
<asp:BoundColum n Visible="False" HeaderText=""
DataField="serv iceplanprogram_ id" />
<asp:BoundColum n HeaderText="Pro gram" DataField="prog ram_name" />
<asp:TemplateCo lumn HeaderText="Not es">
<ItemTemplate >
<ASP:TextBox id="txtActivity Notes" runat="server" Text=""
TextMode="Multi line" columns="15" rows="3" />
</ItemTemplate>
</asp:TemplateCol umn>
<asp:TemplateCo lumn ItemStyle-Width="20%" HeaderText="Cur rent
progress toward goals<br />(1 lowest, 3 highest)">
<ItemTemplate >
<asp:dropdownli st id="ddlCurrent_ progress" CssClass="requi red"
runat="server">
<asp:listitem text="(unspecif ied)" value="-1" runat="server" />
<asp:listitem text="1" value="1" runat="server" />
<asp:listitem text="2" value="2" runat="server" />
<asp:listitem text="3" value="3" runat="server" />
</asp:dropdownlis t>
</ItemTemplate>
</asp:TemplateCol umn>

<asp:TemplateCo lumn HeaderText="Com ments">
<ItemTemplate >
<ASP:Repeater id="rptActiviti es"
DataSource='<%# GetActivities( Container.DataI tem("program_id ") )
%>'
runat="server">
<ItemTemplate >
<table border="0">
<tr>
<td width="70%">
<ASP:CheckBox id="chkActivity ID" Value='<%#
Container.DataI tem("activity_i d") %>' runat="server" Text='<%#
Container.DataI tem("name") %>' />
</td>
<td width="30%">
<ASP:TextBox id="txtActivity _other" visible='<%#
ShowOther(Conta iner.DataItem(" is_allow_additi onal_text")) %>'
maxlenght="100" runat="server" columnspan="10" />
</td>
</table>
</ItemTemplate>
</ASP:Repeater>
</ItemTemplate>
</asp:TemplateCol umn>

</Columns>
</ASP:DataGrid>
</asp:tablecell>
</asp:tablerow>

<asp:tablerow runat="server">
<asp:tablecel l columnspan="2" runat="server" HorizontalAlign ="center"
runat="server">
<asp:button id="btnSaveServ icePlanUpdate" Text="Save" Visible="true"
runat="server" CommandName="sa veupdate"
OnClick="btnSav eServicePlanUpd ate_OnClick" />
</asp:tablecell>
</asp:tablerow>



.....
Thanks
Nov 18 '05 #1
4 1529
Also one more point, there are few grids on this page, but I need to
reference only this one

"News" <ge**@lycos.com > wrote in message
news:du******** ************@ma gma.ca...
I have a page with many controls. Among these controls there is a table
which is a datagrid with nested repeater inside. My problem is that I can
not use DataGridCommand EventArgs to get datagrid elements because submit
button is not in datagrid and uses onClick event btnSaveServiceP lanUpdate.
Here is the code:

Sub btnSaveServiceP lanUpdate_OnCli ck(sender As Object, e As EventArgs)
' need to get the key value serviceplanprog ram_id and other elements of
datagrid here
....
Response.Write( "<br>Progra m id: " & intProgramID)
Response.Write( "<br>Notes: " & Request.Form("t xtNotes"))
....
End Sub
<asp:table id="tClientNote " runat="server" CellPadding="3" CellSpacing="0" > <asp:tablerow runat="server">
<asp:tablecel l runat="server">
....
<asp:tablerow runat="server">
<asp:tablecel l runat="server"> Notes</asp:tablecell>
<asp:tablecel l runat="server"> <ASP:TextBox id="txtNotes" runat="server" Text="" TextMode="Multi line" Columns="40" Rows="4" /></asp:tablecell>
</asp:tablerow>
<asp:tablerow runat="server">
<asp:tablecel l runat="server"> Added By</asp:tablecell>
<asp:tablecel l runat="server"> <asp:label id="lblAdded_by " Text=""
runat="server" /></asp:tablecell>
</asp:tablerow>
...
<asp:tablerow runat="server">
<asp:tablecel l columnspan="2" runat="server">
<ASP:DataGrid id="dgrdCurrent ServicePlanProg rams" RunAt="Server"
Width="800" BorderWidth="0" CellPadding="3" CellSpacing="0"
HeaderStyle-BackColor="#F6F 6F6"
AlternatingItem Style-BackColor="Alic eBlue"
AutoGenerateCol umns="False" DataKeyField="s erviceplanprogr am_id"
AllowPaging="Fa lse"
OnItemCommand=" Grid_CurrentSer vicePlanProgram Command"
> <ItemStyle VerticalAlign=" top" />
<Columns>
<asp:BoundColum n Visible="False" HeaderText=""
DataField="serv iceplanprogram_ id" />
<asp:BoundColum n HeaderText="Pro gram" DataField="prog ram_name" />
<asp:TemplateCo lumn HeaderText="Not es">
<ItemTemplate >
<ASP:TextBox id="txtActivity Notes" runat="server" Text=""
TextMode="Multi line" columns="15" rows="3" />
</ItemTemplate>
</asp:TemplateCol umn>
<asp:TemplateCo lumn ItemStyle-Width="20%" HeaderText="Cur rent
progress toward goals<br />(1 lowest, 3 highest)">
<ItemTemplate >
<asp:dropdownli st id="ddlCurrent_ progress" CssClass="requi red"
runat="server">
<asp:listitem text="(unspecif ied)" value="-1" runat="server" />
<asp:listitem text="1" value="1" runat="server" />
<asp:listitem text="2" value="2" runat="server" />
<asp:listitem text="3" value="3" runat="server" />
</asp:dropdownlis t>
</ItemTemplate>
</asp:TemplateCol umn>

<asp:TemplateCo lumn HeaderText="Com ments">
<ItemTemplate >
<ASP:Repeater id="rptActiviti es"
DataSource='<%# GetActivities(

Container.DataI tem("program_id ") ) %>'
runat="server">
<ItemTemplate >
<table border="0">
<tr>
<td width="70%">
<ASP:CheckBox id="chkActivity ID" Value='<%#
Container.DataI tem("activity_i d") %>' runat="server" Text='<%#
Container.DataI tem("name") %>' />
</td>
<td width="30%">
<ASP:TextBox id="txtActivity _other" visible='<%#
ShowOther(Conta iner.DataItem(" is_allow_additi onal_text")) %>'
maxlenght="100" runat="server" columnspan="10" />
</td>
</table>
</ItemTemplate>
</ASP:Repeater>
</ItemTemplate>
</asp:TemplateCol umn>

</Columns>
</ASP:DataGrid>
</asp:tablecell>
</asp:tablerow>

<asp:tablerow runat="server">
<asp:tablecel l columnspan="2" runat="server" HorizontalAlign ="center"
runat="server">
<asp:button id="btnSaveServ icePlanUpdate" Text="Save" Visible="true"
runat="server" CommandName="sa veupdate"
OnClick="btnSav eServicePlanUpd ate_OnClick" />
</asp:tablecell>
</asp:tablerow>



....
Thanks

Nov 18 '05 #2
May be I didn't get the problem right. If you know the datagrid name, why
can't you navigate it in the button's OnClick event handler using all
available datagrid members, like SelectrdItem, SelectedIndex?

Eliyahu

"News" <ge**@lycos.com > wrote in message
news:du******** ************@ma gma.ca...
I have a page with many controls. Among these controls there is a table
which is a datagrid with nested repeater inside. My problem is that I can
not use DataGridCommand EventArgs to get datagrid elements because submit
button is not in datagrid and uses onClick event btnSaveServiceP lanUpdate.
Here is the code:

Sub btnSaveServiceP lanUpdate_OnCli ck(sender As Object, e As EventArgs)
' need to get the key value serviceplanprog ram_id and other elements of
datagrid here
....
Response.Write( "<br>Progra m id: " & intProgramID)
Response.Write( "<br>Notes: " & Request.Form("t xtNotes"))
....
End Sub
<asp:table id="tClientNote " runat="server" CellPadding="3" CellSpacing="0" > <asp:tablerow runat="server">
<asp:tablecel l runat="server">
....
<asp:tablerow runat="server">
<asp:tablecel l runat="server"> Notes</asp:tablecell>
<asp:tablecel l runat="server"> <ASP:TextBox id="txtNotes" runat="server" Text="" TextMode="Multi line" Columns="40" Rows="4" /></asp:tablecell>
</asp:tablerow>
<asp:tablerow runat="server">
<asp:tablecel l runat="server"> Added By</asp:tablecell>
<asp:tablecel l runat="server"> <asp:label id="lblAdded_by " Text=""
runat="server" /></asp:tablecell>
</asp:tablerow>
...
<asp:tablerow runat="server">
<asp:tablecel l columnspan="2" runat="server">
<ASP:DataGrid id="dgrdCurrent ServicePlanProg rams" RunAt="Server"
Width="800" BorderWidth="0" CellPadding="3" CellSpacing="0"
HeaderStyle-BackColor="#F6F 6F6"
AlternatingItem Style-BackColor="Alic eBlue"
AutoGenerateCol umns="False" DataKeyField="s erviceplanprogr am_id"
AllowPaging="Fa lse"
OnItemCommand=" Grid_CurrentSer vicePlanProgram Command"
> <ItemStyle VerticalAlign=" top" />
<Columns>
<asp:BoundColum n Visible="False" HeaderText=""
DataField="serv iceplanprogram_ id" />
<asp:BoundColum n HeaderText="Pro gram" DataField="prog ram_name" />
<asp:TemplateCo lumn HeaderText="Not es">
<ItemTemplate >
<ASP:TextBox id="txtActivity Notes" runat="server" Text=""
TextMode="Multi line" columns="15" rows="3" />
</ItemTemplate>
</asp:TemplateCol umn>
<asp:TemplateCo lumn ItemStyle-Width="20%" HeaderText="Cur rent
progress toward goals<br />(1 lowest, 3 highest)">
<ItemTemplate >
<asp:dropdownli st id="ddlCurrent_ progress" CssClass="requi red"
runat="server">
<asp:listitem text="(unspecif ied)" value="-1" runat="server" />
<asp:listitem text="1" value="1" runat="server" />
<asp:listitem text="2" value="2" runat="server" />
<asp:listitem text="3" value="3" runat="server" />
</asp:dropdownlis t>
</ItemTemplate>
</asp:TemplateCol umn>

<asp:TemplateCo lumn HeaderText="Com ments">
<ItemTemplate >
<ASP:Repeater id="rptActiviti es"
DataSource='<%# GetActivities(

Container.DataI tem("program_id ") ) %>'
runat="server">
<ItemTemplate >
<table border="0">
<tr>
<td width="70%">
<ASP:CheckBox id="chkActivity ID" Value='<%#
Container.DataI tem("activity_i d") %>' runat="server" Text='<%#
Container.DataI tem("name") %>' />
</td>
<td width="30%">
<ASP:TextBox id="txtActivity _other" visible='<%#
ShowOther(Conta iner.DataItem(" is_allow_additi onal_text")) %>'
maxlenght="100" runat="server" columnspan="10" />
</td>
</table>
</ItemTemplate>
</ASP:Repeater>
</ItemTemplate>
</asp:TemplateCol umn>

</Columns>
</ASP:DataGrid>
</asp:tablecell>
</asp:tablerow>

<asp:tablerow runat="server">
<asp:tablecel l columnspan="2" runat="server" HorizontalAlign ="center"
runat="server">
<asp:button id="btnSaveServ icePlanUpdate" Text="Save" Visible="true"
runat="server" CommandName="sa veupdate"
OnClick="btnSav eServicePlanUpd ate_OnClick" />
</asp:tablecell>
</asp:tablerow>



....
Thanks

Nov 18 '05 #3
Yes, I know the name but I can not find a way to directly reference it.
I am sure this is more simple than I have come up with, I did it this way:

Dim dgItem As DataGridItem

For Each rptItem In oRepeater.Items
intProgramID = dgItem.Cells(0) .Text
....

Next


"Eliyahu Goldin" <re************ *@monarchmed.co m> wrote in message
news:ON******** *****@tk2msftng p13.phx.gbl...
May be I didn't get the problem right. If you know the datagrid name, why
can't you navigate it in the button's OnClick event handler using all
available datagrid members, like SelectrdItem, SelectedIndex?

Eliyahu

"News" <ge**@lycos.com > wrote in message
news:du******** ************@ma gma.ca...
I have a page with many controls. Among these controls there is a table
which is a datagrid with nested repeater inside. My problem is that I can not use DataGridCommand EventArgs to get datagrid elements because submit
button is not in datagrid and uses onClick event btnSaveServiceP lanUpdate.

Here is the code:

Sub btnSaveServiceP lanUpdate_OnCli ck(sender As Object, e As EventArgs)
' need to get the key value serviceplanprog ram_id and other elements of
datagrid here
....
Response.Write( "<br>Progra m id: " & intProgramID)
Response.Write( "<br>Notes: " & Request.Form("t xtNotes"))
....
End Sub
<asp:table id="tClientNote " runat="server" CellPadding="3"

CellSpacing="0" >
<asp:tablerow runat="server">
<asp:tablecel l runat="server">
....
<asp:tablerow runat="server">
<asp:tablecel l runat="server"> Notes</asp:tablecell>
<asp:tablecel l runat="server"> <ASP:TextBox id="txtNotes"

runat="server"
Text="" TextMode="Multi line" Columns="40" Rows="4" /></asp:tablecell>
</asp:tablerow>
<asp:tablerow runat="server">
<asp:tablecel l runat="server"> Added By</asp:tablecell>
<asp:tablecel l runat="server"> <asp:label id="lblAdded_by " Text=""
runat="server" /></asp:tablecell>
</asp:tablerow>
...
<asp:tablerow runat="server">
<asp:tablecel l columnspan="2" runat="server">
<ASP:DataGrid id="dgrdCurrent ServicePlanProg rams" RunAt="Server"
Width="800" BorderWidth="0" CellPadding="3" CellSpacing="0"
HeaderStyle-BackColor="#F6F 6F6"
AlternatingItem Style-BackColor="Alic eBlue"
AutoGenerateCol umns="False" DataKeyField="s erviceplanprogr am_id"
AllowPaging="Fa lse"
OnItemCommand=" Grid_CurrentSer vicePlanProgram Command"
>

<ItemStyle VerticalAlign=" top" />
<Columns>
<asp:BoundColum n Visible="False" HeaderText=""
DataField="serv iceplanprogram_ id" />
<asp:BoundColum n HeaderText="Pro gram" DataField="prog ram_name" /> <asp:TemplateCo lumn HeaderText="Not es">
<ItemTemplate >
<ASP:TextBox id="txtActivity Notes" runat="server" Text=""
TextMode="Multi line" columns="15" rows="3" />
</ItemTemplate>
</asp:TemplateCol umn>
<asp:TemplateCo lumn ItemStyle-Width="20%" HeaderText="Cur rent
progress toward goals<br />(1 lowest, 3 highest)">
<ItemTemplate >
<asp:dropdownli st id="ddlCurrent_ progress" CssClass="requi red"
runat="server">
<asp:listitem text="(unspecif ied)" value="-1" runat="server" /> <asp:listitem text="1" value="1" runat="server" />
<asp:listitem text="2" value="2" runat="server" />
<asp:listitem text="3" value="3" runat="server" />
</asp:dropdownlis t>
</ItemTemplate>
</asp:TemplateCol umn>

<asp:TemplateCo lumn HeaderText="Com ments">
<ItemTemplate >
<ASP:Repeater id="rptActiviti es"
DataSource='<%# GetActivities(

Container.DataI tem("program_id ") )
%>'
runat="server">
<ItemTemplate >
<table border="0">
<tr>
<td width="70%">
<ASP:CheckBox id="chkActivity ID" Value='<%#
Container.DataI tem("activity_i d") %>' runat="server" Text='<%#
Container.DataI tem("name") %>' />
</td>
<td width="30%">
<ASP:TextBox id="txtActivity _other" visible='<%#
ShowOther(Conta iner.DataItem(" is_allow_additi onal_text")) %>'
maxlenght="100" runat="server" columnspan="10" />
</td>
</table>
</ItemTemplate>
</ASP:Repeater>
</ItemTemplate>
</asp:TemplateCol umn>

</Columns>
</ASP:DataGrid>
</asp:tablecell>
</asp:tablerow>

<asp:tablerow runat="server">
<asp:tablecel l columnspan="2" runat="server" HorizontalAlign ="center" runat="server">
<asp:button id="btnSaveServ icePlanUpdate" Text="Save" Visible="true" runat="server" CommandName="sa veupdate"
OnClick="btnSav eServicePlanUpd ate_OnClick" />
</asp:tablecell>
</asp:tablerow>



....
Thanks


Nov 18 '05 #4
dgrdCurrentServ icePlanPrograms .Items doesn't work ?????

Eliyahu

"News" <ge**@lycos.com > wrote in message
news:PK******** ************@ma gma.ca...
Yes, I know the name but I can not find a way to directly reference it.
I am sure this is more simple than I have come up with, I did it this way:

Dim dgItem As DataGridItem

For Each rptItem In oRepeater.Items
intProgramID = dgItem.Cells(0) .Text
....

Next


"Eliyahu Goldin" <re************ *@monarchmed.co m> wrote in message
news:ON******** *****@tk2msftng p13.phx.gbl...
May be I didn't get the problem right. If you know the datagrid name, why
can't you navigate it in the button's OnClick event handler using all
available datagrid members, like SelectrdItem, SelectedIndex?

Eliyahu

"News" <ge**@lycos.com > wrote in message
news:du******** ************@ma gma.ca...
I have a page with many controls. Among these controls there is a table which is a datagrid with nested repeater inside. My problem is that I
can not use DataGridCommand EventArgs to get datagrid elements because submit button is not in datagrid and uses onClick event btnSaveServiceP lanUpdate.

Here is the code:

Sub btnSaveServiceP lanUpdate_OnCli ck(sender As Object, e As EventArgs)
' need to get the key value serviceplanprog ram_id and other elements of datagrid here
....
Response.Write( "<br>Progra m id: " & intProgramID)
Response.Write( "<br>Notes: " & Request.Form("t xtNotes"))
....
End Sub
<asp:table id="tClientNote " runat="server" CellPadding="3"

CellSpacing="0" >
<asp:tablerow runat="server">
<asp:tablecel l runat="server">
....
<asp:tablerow runat="server">
<asp:tablecel l runat="server"> Notes</asp:tablecell>
<asp:tablecel l runat="server"> <ASP:TextBox id="txtNotes"

runat="server"
Text="" TextMode="Multi line" Columns="40" Rows="4" /></asp:tablecell>
</asp:tablerow>
<asp:tablerow runat="server">
<asp:tablecel l runat="server"> Added By</asp:tablecell>
<asp:tablecel l runat="server"> <asp:label id="lblAdded_by " Text=""
runat="server" /></asp:tablecell>
</asp:tablerow>
...
<asp:tablerow runat="server">
<asp:tablecel l columnspan="2" runat="server">
<ASP:DataGrid id="dgrdCurrent ServicePlanProg rams" RunAt="Server"
Width="800" BorderWidth="0" CellPadding="3" CellSpacing="0"
HeaderStyle-BackColor="#F6F 6F6"
AlternatingItem Style-BackColor="Alic eBlue"
AutoGenerateCol umns="False" DataKeyField="s erviceplanprogr am_id" AllowPaging="Fa lse"
OnItemCommand=" Grid_CurrentSer vicePlanProgram Command"
>
<ItemStyle VerticalAlign=" top" />
<Columns>
<asp:BoundColum n Visible="False" HeaderText=""
DataField="serv iceplanprogram_ id" />
<asp:BoundColum n HeaderText="Pro gram" DataField="prog ram_name" /> <asp:TemplateCo lumn HeaderText="Not es">
<ItemTemplate >
<ASP:TextBox id="txtActivity Notes" runat="server" Text=""
TextMode="Multi line" columns="15" rows="3" />
</ItemTemplate>
</asp:TemplateCol umn>
<asp:TemplateCo lumn ItemStyle-Width="20%" HeaderText="Cur rent
progress toward goals<br />(1 lowest, 3 highest)">
<ItemTemplate >
<asp:dropdownli st id="ddlCurrent_ progress" CssClass="requi red" runat="server">
<asp:listitem text="(unspecif ied)" value="-1"
runat="server" /> <asp:listitem text="1" value="1" runat="server" />
<asp:listitem text="2" value="2" runat="server" />
<asp:listitem text="3" value="3" runat="server" />
</asp:dropdownlis t>
</ItemTemplate>
</asp:TemplateCol umn>

<asp:TemplateCo lumn HeaderText="Com ments">
<ItemTemplate >
<ASP:Repeater id="rptActiviti es"
DataSource='<%# GetActivities(

Container.DataI tem("program_id ") )
%>'
runat="server">
<ItemTemplate >
<table border="0">
<tr>
<td width="70%">
<ASP:CheckBox id="chkActivity ID" Value='<%#
Container.DataI tem("activity_i d") %>' runat="server" Text='<%#
Container.DataI tem("name") %>' />
</td>
<td width="30%">
<ASP:TextBox id="txtActivity _other" visible='<%#
ShowOther(Conta iner.DataItem(" is_allow_additi onal_text")) %>'
maxlenght="100" runat="server" columnspan="10" />
</td>
</table>
</ItemTemplate>
</ASP:Repeater>
</ItemTemplate>
</asp:TemplateCol umn>

</Columns>
</ASP:DataGrid>
</asp:tablecell>
</asp:tablerow>

<asp:tablerow runat="server">
<asp:tablecel l columnspan="2" runat="server" HorizontalAlign ="center" runat="server">
<asp:button id="btnSaveServ icePlanUpdate" Text="Save" Visible="true" runat="server" CommandName="sa veupdate"
OnClick="btnSav eServicePlanUpd ate_OnClick" />
</asp:tablecell>
</asp:tablerow>



....
Thanks



Nov 18 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2069
by: John R. Dougherty | last post by:
Using VB.NET: I am populating a DataTable from a SQL Server table, then associating that DataTable to a DataGrid control. I want to disallow the user from inserting new records on that DataGrid, but I cannot find a way to do this. Is there a way to prevent a user from inserting a new row through the DataGrid - either in the DataGrid itself, or in the original DataTable I am creating? - Thanks, JRD
3
1917
by: Fortra | last post by:
I'm having trouble with the UpdateCommand event with the DataGrid control. The event is wired up in the InitializeComponents properly, this.sitesDataGrid.UpdateCommand += new System.Web.UI.WebControls.DataGridCommandEventHandler (this.sitesDataGrid_UpdateCommand); but when the "Update" button is clicked, the eventhandler is never fired. The "Edit" command fires its
0
996
by: Stephen Cairns | last post by:
I am very new to programming and in particular datagrids and am finding it difficult to add code to the event handler below to run an UpdateCommand on a row in my datagrid. Could someone please help me out code into this event handler so as when I click Update the database is updated with my ammendments in the datagrid. I would really appreciate your help. private void DataGrid2_EditCommand(object source,...
1
7588
by: Shourie | last post by:
I've noticed that none of the child controls events are firing for the first time from the dynamic user control. Here is the event cycle. 1) MainPage_load 2) User control1_Load user clicks a dropdown in UC1 _________________________ 1) MainPage_Load 2) User Control_1 Load
2
1288
by: hansiman | last post by:
When I want to add a js confirm box to a delete button that is positioned in the last column in a datagrid row I do the following in the ItemDataBound event: Dim delBtn As LinkButton = e.Item.Cells(10).Controls(0) delBtn.Attributes("onclick") = "javascript:return confirm('you sure?');" If I want to change an image in a datagrid row I do the following in the ItemDataBound event:
11
2055
by: CM Manager via DotNetMonster.com | last post by:
I am very frustrated due to this exception error I am receiving. I've tried searching numerous user support groups, Microsoft Support Net, Google, etc. and haven't found exactly my situation. Hopefully someone here can help. I am just learning VB.NET and purchased the SAM's "Teach Yourself VB.NET 2003 in 21 days' book. I am trying to connect to an Access database I created locally on my computer per Chapter 16. I originally had it on a...
4
2138
by: Jeff User | last post by:
Hi I tryed to solve this problem over in the framework.asp group, but still am having trouble. Hope someone here can help. using .net 1.1, VS 2003 and C# I have an asp.DataGrid control with a Delete button on the end of each row. I am unable to gain access to the event when the button is clicked. I don't fully understand how the click gets connected to the C# code,
7
22880
by: Rob Dob | last post by:
The following code is giving me a timeout problem., no matter what I do I can't send a piece of mail using .net2.0 System.Net.Mail.SmtpClient via port 465 and using ssl, if however I try using outlook or outlook express it works fine.. System.Net.Mail.MailMessage msgMail = new System.Net.Mail.MailMessage("myemail@mydomain.com", "testemail@mydomain.com", "subject", "message body");
275
12404
by: Astley Le Jasper | last post by:
Sorry for the numpty question ... How do you find the reference name of an object? So if i have this bob = modulename.objectname() how do i find that the name is 'bob'
0
9643
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9480
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10319
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9947
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8971
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5380
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4046
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3645
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.