I need to add an extra header with merged cells to my gridview and it's quite easy to do it.
The problem is as soon a extra header exists in the GridView, the Edit-Update doesn't work anymore. Update to be precise. When I press Update, all the columns become empty and the extra-header's rows are gone.
Anyone achieved to add an extra header rows but with a working Update ?
Related
I have a grid that presents database entities one per row with some crud options (the crud options are icons in their own cells). When the delete button is clicked, the design calls for the entire row to be turned into a confirmation message with buttons to continue or cancel.
Apparently you can give a function for colSpan on each colDef. I tried giving the first colDef a span equal to the number of displayed columns in the case that the row data has a property isDeleting === true, while clicking the delete icon would set the row data's isDeleting property to true.
I was unable to get this to work, and even if I were to get it to work, I'd need to be able to dynamically change the cell so that it contains the confirmation message.
Any help is greatly appreciated.
After a very long day of searching, I found this article on "full-width" rows. You can provide your gridOptions with an isFullWidthCell function, plus fullWidthCellRenderer and fullWidthCellRendererParams properties, and the full width of the row will be populated using the renderer according to the params (as is the case with a cellRenderer in a ColDef)
So, my delete button component can set a piece of data that the isFullWidthCell function can check for, and if it finds it, it will use the cellRenderer provided.
AgGrid seems to have thought of everything.
I need to add dynamically row to my grid (ok), but the first cell need to be numeric, the second one text and so on.
But, I didn't find any example for this, it's always in the .xalm :/
Thanks for your help
This should be a lot easier than it appears to be, but I'm having an issue with it.
Conditions
If upon entering this specific page, if there is only one record in the grid (based on a status value in a dropdown), hide the grid and show a table with the details of that record.
If there is more than one record, display the grid with the records.
When a record is selected, display the table with the details of that record.
When I go into the page currently, there is only one record, so it is displaying the table. If I change the value of the dropdown to another status, more than one record is in the grid and the table is hidden. Previously (by another programmer) it was being set to Visible = false. Obviously, this is not a property of the table. However, it previously worked as when someone would select a row, they would set the Visible = true and the table would show.
I've now changed it to hide by using:
tblDetails.Attributes("style") = "display:none"
However, trying to replace the Visible = true is not working:
tblDetails.Attributes.Remove("style")
I have also tried:
tblDetails.Attributes("style") = ""
Someone please point out to me the solution that is going to make me slap my forehead. Thanks.
use setAttribute(attr,value) to change the value of each Element You want
like below example
yourelement.setAttribute("style","");//it is to change value
yourelement.removeAttribute("style")//it is used to remove style attrb from your element
I have one huge update panel that covers my whole page (Which is a table). The problem is in this table, each cell has another table in it which stores data and displays it. I already made my huge update panel cover the larger table, but how can I add in an update panel to the smaller tables? Thanks! The reason I Need this is because each column has different data that needs to be updated at different times! Cheers!
how can I add in an update panel to the smaller tables?
An UpdatePanels can be nested without a problem. If you don't want the outer one to be updated make the UpdateMode of the inner panel Conditional.
However, I would also recommend moving away from UpdatePanels altogether and using jQuery/Json directly - you'll be able to make more efficient (less data and updating) web pages.
I have a really weird issue. I have a Gridview, which I bind to a Dataview programtically. My Gridview has 11 columns. Sorting works fine as long as I do not remove any columns programtically.
In certain cases I remove 2 of the columns from the Gridview. Still not a problem. All the data is properly displayed however the problem occurs when I sort one of the columns. I sort the Dataview and bind to the Gridview again. Data from two of my columns just vanishes. Both of these columns are based on ItemTemplates. The columns are still displayed but just empty cells.
Any ideas? Thanks.
Instead of removing the columns, hide them. The bound item's indexes are confused by removing the columns from the grid only and not the DataSource.
A better solution would be not to ever render those columns at all if you are always hiding them. If there are conditions to which they are removed, then hide them. CSS is an easy way to do that.