Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ButtonCommand in a datagrid
Message
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00777282
Message ID:
00777327
Views:
8
Hi Stephen,

You need to use the tag asp:EditCommandColumn for the button like the following:
<asp:EditCommandColumn ButtonType="LinkButton" UpdateText="Update" CancelText="Cancel" EditText="Edit">
  <HeaderStyle Wrap="False"></HeaderStyle>
  <ItemStyle Wrap="False"></ItemStyle>
  <FooterStyle Wrap="False"></FooterStyle>
</asp:EditCommandColumn>
For a sample page, look at the following link and download the "Example 1: Accessing Visual FoxPro Data Using OLE DB" solution. You will see how the grid uses the edit button.


>I have a ButtonCommand in a grid C# page.
>
>This code won't fire?
>public void Button_Edit(Object sender, DataGridCommandEventArgs e)
>{
>// grab value and place in session.
>Session["aPage"] = MmDataGrid1.SelectedItem.ToString();
>}
>
>
>In my html for the grid:
>OnEditCommand="Button_Edit">
>
>Html for the button:
>{asp:ButtonColumn ButtonType="PushButton" DataTextField="ap_part" HeaderText="PTO Model" CommandName="Button_Edit">
>{ItemStyle Wrap="False">{/ItemStyle>
>{/asp:ButtonColumn>
>
>What am I missing here? Also how do you scrape the Button Text which is a part # that I need to pass back for a data request?
>
>TIA
-----------------------------------------

Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.com
www.prenia.com
Weblog: blogs.prenia.com/cathi
Previous
Reply
Map
View

Click here to load this message in the networking platform