I am converting an existing ASp.NET design which uses MS grid to use Aspose WebGrid. have a requirement to display a color palette dropdown list in a grid cell. I know how to set the cell’s background color on the client side (in js using cell.orgBgColor=selColor; statement, easy enough, however, my dropdown itself is supposed to have be colored. My grid is data bound to a collection, and grid ‘color’ column is also bound. I can also set the initial BackColor selection on the server side when page renders with no problem, but how can I control the background color in the dropdown popup itself? here is what I use for the bind column to display the popup- currently the “Red|Blue|Green|Yellow|White” all show up on white backgroud on the popup, I need them to be, respectively, on “Red|Blue|Green|Yellow|White” background
<acw:BindColumn Caption=“Color” DataField=“Color” UseAlternativeStyle=“False” Width=“70px” >
</acw:BindColumn>
In the current MS grid approach, I use a template field with an asp: DropDownList control and assign a style to each ListItem in DropDownList server side:
for (int rowCount = 0; rowCount < ddlColorList.Items.Count; rowCount++)How would I assign the background color to each item in the GridWeb dropdown? I would hate to still use ASP.Net DropDownList and anchor it to the clicked cell, size it to cell size and then pop it up in response to a cell click, unless there is no other easy way around…
{
ddlColorList.Items[rowCount].Attributes.Add(“style”, “background-color:” + SetBackGroundColor(ddlColorList.Items[rowCount].Value));
}