Jump to content
Software FX Community

Grid Multi-Select


pbursch
 Share

Recommended Posts

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

Link to comment
Share on other sites

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 

 

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...