pbursch Posted April 3, 2008 Report Share Posted April 3, 2008 I need to be able to select one or more rows from the grid. I would like to know how to do this in two different manners. 1) By selecting multiple grid rows. and 2) By place a check box in a column of each row. Can you point me to an example of how this can be programmed using GridFX? Thanks Quote Link to comment Share on other sites More sharing options...
TomasT Posted April 4, 2008 Report Share Posted April 4, 2008 Hi, Unfortunately, the first selection method is not currently possible with GridFX. We understand the usefulness of such a feature and will be considering it for inclusion in a future service pack. On the other hand, your second request is indeed possible. All you need to do is add a Template column to the grid and edit the template to drop a checkbox. Once the textbox is added to the field, you add a button or capture a postback in order to loop through the items and check which ones have ben checked. Something like this: protected void Button1_Click(object sender, EventArgs e) { foreach (GridItem item in Grid1.Items) { CheckBox CheckOneItem = (CheckBox)item.Cells[6].FindControl("ItemCheckBox"); if (CheckOneItem.Checked) { TextBox2.Text += item.Cells[1].Text; } } } Does this make sense? What operation do you need to perform on the selected items? Thanks. TT Quote Link to comment Share on other sites More sharing options...
pbursch Posted April 4, 2008 Author Report Share Posted April 4, 2008 Is there an example for adding a templated column available that I could take a look at? Thanks. Paul Quote Link to comment Share on other sites More sharing options...
StephenP Posted April 8, 2008 Report Share Posted April 8, 2008 Template columns are easy to add through the wizard. You just go to "Edit Layout", then go "Add New"->"Blank Template". That will create the template column and let you edit it.For your specific example, you could just use this markup: <Columns><GridFX:TemplateColumn><ItemTemplate><asp:CheckBox runat="server" ID="ItemCheckBox" /></ItemTemplate></GridFX:TemplateColumn>Does that solve your problem? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.