|
First, you can create a TemplatedColumn to place the LinkButton control inside of the column:<igtbl:TemplatedColumn BaseColumnName=”ProductName” IsBound=”True” Key=”ProductName”>
<Header Caption=”ProductName”> <RowLayoutColumnInfo OriginX=”1″ /> </Header> <CellTemplate> <asp:LinkButton runat=”server” ID=”MyLinkButton” Text=”Press Me” CommandName=”Edit” OnClick=”MyLinkButton_Click” CommandArgument=”<%# Container.Cell.Row.Index %>” /> </CellTemplate> <Footer> <RowLayoutColumnInfo OriginX=”1″ /> </Footer> </igtbl:TemplatedColumn>In the LinkButton in the template there are a couple things to notice. First, the Click event is specified with a event handler MyLinkButton_Click method defined. Next, the CommandArgument property is specified. Its value is set to the Index of the Row that the Cell the LinkButton is in. Then in your code behind, all you need to do is define the Click events handler then access the LinkButtons CommandArgument to figure out what row was clicked. Once you know the row, you can get the values from any cell in that row: protected void MyLinkButton_Click(object sender, EventArgs e) object id = this.UltraWebGrid1.Rows[int.Parse(button.CommandArgument)].Cells.FromKey(“ColumnID”).Value; Hope that helps. Devin Product Manager :: Web Client
http://www.infragistics.comhttp://blogs.infragistics.com/blogs/devin_rader/ http://www.geekswithblogs.com/devin Infragistics Developer Support: http://www.infragistics.com/gethelp |