Hi,
I've got a webgrid with 2 bands in it. I've put a single column containing checkboxes in the first band and the second band I just want to able to bind a datatable to and have it dynamically generate the column headers.
However when I bind the data to the grid it's binding it into the first band not the second.
Is there any way to force the data to bind to the second band?
Specifying the column headers at design time isn't an option for me.
Thanks.
Sounds like a possible bug to me. I'll have somone in our QA department test this scenario.
-Tony
Hi Tony,
I was implementing the copy client side. I was setting the selected property of any checked rows to true and then using grid.copy() to copy all the selected rows to the clipboard.
When I hid the column after setting all the rows to selected and called copy, nothing was being copied to the clipboard. If I didn't hide the column and called copy the selected rows were copied including a true/false value at the start of each row to indicate the status of the checkbox.
I've actually gotten around this now by just leaving the column visible and editing the text on the clipboard, removing the true/false text if it's there & then reconstituting what's on the clipboard. It's a total hack but it does the job.
Hi Colette,
I'm not sure I'm following you completely - how are you implementing the copy? Are you copying on the client-side or server-side? What happens when you attempt to copy? A code snippet or a more detailed description may clear things up for me.
Thanks Tony, I had a feeling that might be the case.
In trying to get around this then I've accepted that the checkbox column will always be the first column in the grid.
I iterate through the rows in the column and check each row to see if the checkbox value is true or false and set the row to be selected accordingly, that bit is working fine for me.
However, I then hide the column and try to copy each row, this is where it's falling down on me. If I don't hide the column it works fine but when I do hide the column the copy fails.
Is there any way around this? Basically I need to be able to copy the row without copying the value of the checkbox column. I could do it by going into the clipboard and removing the true/false but I'd rather avoid that if I can at all.
Thanks,
Colette
You can't have a combination of Bound/Unbound span across bands, which is probably why it appears that the databind is applying to the top level. You'll either have to bind the entire grid, or manually populate the entire grid.
Hope this helps,