Private Sub ddlWorkCentre_SelectedIndexChanged_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ddlWorkCentre.SelectedIndexChanged |
If Not pIsLoading Then |
For Each pWorkCentre As WorkCentre In WorkCentresList |
If ddlWorkCentre.SelectedValue = pWorkCentre.ID Then |
txtWorkCentreDesc.Text = pWorkCentre.Description |
BindWorkOrders(pWorkCentre.ID) |
End If |
Next |
End If |
End Sub |
Private Sub frmWorkCentreLog_Activated(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Activated |
pIsLoading = False |
End Sub |
Hello,
Having some problems with the radgridview.
In the CellFormatting event i add some backgroundcolors and a progressbar to the grid.
All works fine here.
But when I collapse and expand the groups in the grid. The progressbar is moving up and down a copple a rows ( not corresponding with the data in the rows).
Any suggestions?
Kind regards,
Tim van Rooijen
private void radGridViewProductie_CellFormatting(object sender, Telerik.WinControls.UI.CellFormattingEventArgs e)
{
// exclude header element in the data column
if (e.CellElement.ColumnInfo is GridViewDataColumn && !(e.CellElement.RowElement is GridTableHeaderRowElement))
{
GridViewDataColumn column = (GridViewDataColumn)e.CellElement.ColumnInfo;
GridViewRowInfo gvri = e.CellElement.RowInfo;
if (gvri != null)
{
SchrapView Sv = (SchrapView)gvri.DataBoundItem;
if (Sv != null)
{
//Voor percentage velden worden weergegeven met een progressbar
if (column.FieldName == "VorigeBewerking.PercentageCompleet" || column.FieldName == "Nacalculatie.PercentageCompleet")
{
// check if the progress bar is already added to the cell
if (e.CellElement.Children.Count > 0)
return;
RadProgressBarElement element = new RadProgressBarElement();
e.CellElement.Children.Add(element);
element.StretchHorizontally = true;
element.StretchVertically = true;
// extract the value in the cell, convert it to a value
// usable in the progress bar element and assign it to the
// progress bar Value1 and Text properties
int discountPercentage = Convert.ToInt32(e.CellElement.Text);
if (discountPercentage > 100)
{
element.Value1 = 100;
}
else
{
element.Value1 = discountPercentage;
}
element.Text = discountPercentage.ToString() + "%";
}
if (column.FieldName == "Indicator")
{
if (!Sv.AchterGrondKleur.IsEmpty)
{
e.CellElement.BackColor = Sv.AchterGrondKleur;
e.CellElement.DrawFill = true;
}
else
{
e.CellElement.BackColor = Color.Transparent;
e.CellElement.BackColor2 = Color.Transparent;
e.CellElement.DrawFill = true;
}
}
}
}
if (e.ChildViewInfo.Rows.Length < 6) |
{ |
e.ChildViewInfo.ViewTemplate.Columns[(int)RecordScorpion.Column.Network].Width = grdRecord.Columns[(int)RecordScorpion.Column.Network].Width - 1; |
e.ChildViewInfo.ViewTemplate.Columns[(int)RecordScorpion.Column.Item].Width = grdRecord.Columns[(int)RecordScorpion.Column.Item].Width - 1; |
e.ChildViewInfo.ViewTemplate.Columns[(int)RecordScorpion.Column.Value].Width = grdRecord.Columns[(int)RecordScorpion.Column.Value].Width; |
e.ChildViewInfo.ViewTemplate.Columns[(int)RecordScorpion.Column.Date].Width = grdRecord.Columns[(int)RecordScorpion.Column.Date].Width; |
e.ChildViewInfo.ViewTemplate.Columns[(int)RecordScorpion.Column.Line].Width = grdRecord.Columns[(int)RecordScorpion.Column.Line].Width; |
} |
else |
{ |
e.ChildViewInfo.ViewTemplate.Columns[(int)RecordScorpion.Column.Network].Width = grdRecord.Columns[(int)RecordScorpion.Column.Network].Width - 20; |
e.ChildViewInfo.ViewTemplate.Columns[(int)RecordScorpion.Column.Item].Width = grdRecord.Columns[(int)RecordScorpion.Column.Item].Width - 1; |
e.ChildViewInfo.ViewTemplate.Columns[(int)RecordScorpion.Column.Value].Width = grdRecord.Columns[(int)RecordScorpion.Column.Value].Width; |
e.ChildViewInfo.ViewTemplate.Columns[(int)RecordScorpion.Column.Date].Width = grdRecord.Columns[(int)RecordScorpion.Column.Date].Width; |
e.ChildViewInfo.ViewTemplate.Columns[(int)RecordScorpion.Column.Line].Width = grdRecord.Columns[(int)RecordScorpion.Column.Line].Width; |
} |
ThemeResolutionService.ApplicationThemeName = m_themeName; |