I am working on Winform application. Using Telerik controls on it.
On 1 form, I need to have composite columns as in image below. These columns have been added dynamically(through C#), I have used HTMlViewDefinition.
The problem is, columns boundaries are getting overlapped as in image below.
I need the column width to be decided at run time, so don't want to give static width to them.
Code, I have written for this grid is as below
var htmlView = new HtmlViewDefinition()
{
};
htmlView.RowTemplate.Rows.Add(new RowDefinition());
htmlView.RowTemplate.Rows.Add(new RowDefinition());
htmlView.RowTemplate.Rows[0].Cells.Add(new CellDefinition("No"));
htmlView.RowTemplate.Rows[0].Cells.Add(new CellDefinition("Item No"));
htmlView.RowTemplate.Rows[0].Cells.Add(new CellDefinition("UOM"));
htmlView.RowTemplate.Rows[0].Cells.Add(new CellDefinition("Pres QTY"));
htmlView.RowTemplate.Rows[0].Cells.Add(new CellDefinition("Disp QTY"));
htmlView.RowTemplate.Rows[0].Cells.Add(new CellDefinition("Refill QTY"));
htmlView.RowTemplate.Rows[0].Cells.Add(new CellDefinition("Dose"));
htmlView.RowTemplate.Rows[0].Cells.Add(new CellDefinition("No of Days"));
htmlView.RowTemplate.Rows[0].Cells.Add(new CellDefinition("English Direction"));
htmlView.RowTemplate.Rows[0].Cells.Add(new CellDefinition("No of Packs"));
htmlView.RowTemplate.Rows[0].Cells.Add(new CellDefinition("Drug Location"));
htmlView.RowTemplate.Rows[0].Cells.Add(new CellDefinition("Available QTY"));
htmlView.RowTemplate.Rows[0].Cells.Add(new CellDefinition("Machine Available QTY"));
htmlView.RowTemplate.Rows[0].Cells.Add(new CellDefinition("Shelves Available QTY"));
htmlView.RowTemplate.Rows[0].Cells.Add(new CellDefinition("Remain to Verify"));
htmlView.RowTemplate.Rows[0].Cells.Add(new CellDefinition("Verification Status"));
htmlView.RowTemplate.Rows[0].Cells[0].RowSpan = 2;
htmlView.RowTemplate.Rows[0].Cells[3].RowSpan = 2;
htmlView.RowTemplate.Rows[0].Cells[4].RowSpan = 2;
htmlView.RowTemplate.Rows[0].Cells[3].ColSpan = 1;
htmlView.RowTemplate.Rows[0].Cells[4].ColSpan = 1;
htmlView.RowTemplate.Rows[0].Cells[5].RowSpan = 2;
htmlView.RowTemplate.Rows[0].Cells[6].RowSpan = 2;
htmlView.RowTemplate.Rows[0].Cells[7].RowSpan = 3;
htmlView.RowTemplate.Rows[0].Cells[9].RowSpan = 2;
htmlView.RowTemplate.Rows[0].Cells[10].RowSpan = 2;
htmlView.RowTemplate.Rows[0].Cells[11].RowSpan = 2;
htmlView.RowTemplate.Rows[0].Cells[12].RowSpan = 2;
htmlView.RowTemplate.Rows[0].Cells[13].RowSpan = 2;
htmlView.RowTemplate.Rows[0].Cells[14].RowSpan = 2;
htmlView.RowTemplate.Rows[0].Cells[15].RowSpan = 2;
htmlView.RowTemplate.Rows[0].Height = 30;
htmlView.RowTemplate.Rows[1].Cells.Add(new CellDefinition("Item Description"));
htmlView.RowTemplate.Rows[1].Cells[0].ColSpan = 2;
htmlView.RowTemplate.Rows[1].Cells.Add(new CellDefinition("Direction"));
htmlView.RowTemplate.Rows[1].Height = 30;
gridDrugList.BestFitColumns();
gridDrugList.MasterTemplate.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;
gridDrugList.ViewDefinition = htmlView;
Aucun commentaire:
Enregistrer un commentaire