Hello, I have an ultrawebgrid. The first column is a template column with an imagebutton as the only control. once I click the add new button, the row appears, but the control is not there. Any help would be appreciated. Below is the templated column in the webgrid.
<igtbl:TemplatedColumn AllowGroupBy="No" FilterIcon="False" ServerOnly="false" > <CellTemplate> <asp:ImageButton ID="btnDeleteResource" runat="server" ImageUrl="~/images/delete.png" CommandArgument="Delete" OnClientClick="return confirm('Delete Selected Row?');" CommandName="Delete" /> <asp:Button runat="server" Text="test" /> </CellTemplate> <Header> <RowLayoutColumnInfo OriginX="1"></RowLayoutColumnInfo> </Header> <Footer> <RowLayoutColumnInfo OriginX="1"></RowLayoutColumnInfo> </Footer> </igtbl:TemplatedColumn>
Vince, I have a templated column that shows a usercontrol inside it. When the user types inside the control, hidden cells get loaded with the data. Everything works fine until I delete a row (fires DeleteRow) but the event is cancelled on the server because of a business rule. I set e.Cancel = true and the deleted row reappeares, but the data is missing in my custom control (but it is present in the auxiliary hidden cells). I found out it's because the InitializeRow event does not get fired (that's where I load the data into my control when getting it from the database). How do I solve this problem? should I use a different event to load the data into the control?
here is the jscript to set the value of the button.
igtbl_getGridById(gridName).Rows.getRowById(rowId).getCellFromKey("ColName").setValue("your text");
Here is the C# do this on initializerow
e.Row.Cells[0].Value = "your text";
that would be very nice to know on this end. Please share here if you find out how to winned.
How do we add the image to the button if we select column of Type="Button"
mhurter said:One thing about the button column that I cannot figure out is how to set the text of the button?
I'm glad to have helped.