We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Grouping Grid Cell DropdownList not refreshing the correct contents.

Hello All,

I am facing a wierd refresh situation with dropdowns.

I click on a dropdownlist which has 2 items/cells like "OPEN" and "CLOSE". But I can see only the last item "CLOSE" in the dropdown's 1st cell. The 2nd cell is empty.

When I move my mouse cursor towards the upper border of my dropdownlist, it shows the correct contents in an animated way dynamically filling both cells with values "OPEN" and "CLOSE".

We have not handled any mouse events.

Its surely a bug. Need to know any fixes/workarounds for this issue.

Find the attachments for more details.

Regards,
Joe

dropdown_refresh.zip

10 Replies

AD Administrator Syncfusion Team December 8, 2006 10:49 AM UTC

Hi Joe,
Please try this code snippet and let us know if this helps.

private void gridGroupingControl1_TableControlCurrentCellShowingDropDown(object sender, GridTableControlCurrentCellShowingDropDownEventArgs e)
{
GridCurrentCell cc = e.TableControl.CurrentCell;
GridComboBoxCellRenderer cr = cc.Renderer as GridComboBoxCellRenderer;
if( cr != null)
cr.ListControlPart.Refresh();
}

Best Regards,
Jeba


PA Pawan Adur December 11, 2006 07:53 AM UTC

Hi Jeba,
i tried out ur solution .still the problem persists. also some times the DropDown List is unable to catch events.
plz find a fix for this

Thanx
Pawan

>Hi Joe,
Please try this code snippet and let us know if this helps.

private void gridGroupingControl1_TableControlCurrentCellShowingDropDown(object sender, GridTableControlCurrentCellShowingDropDownEventArgs e)
{
GridCurrentCell cc = e.TableControl.CurrentCell;
GridComboBoxCellRenderer cr = cc.Renderer as GridComboBoxCellRenderer;
if( cr != null)
cr.ListControlPart.Refresh();
}

Best Regards,
Jeba


AD Administrator Syncfusion Team December 11, 2006 08:53 AM UTC

Hi Pawan,

Are you using GridListControl celltype in a grid? If so, you can access the GridDropDownGridListControlCellRenderer and use the ListControlPart.Grid.Refresh() method to refresh the grid. Here is a code snippet to show this.

private void gridGroupingControl1_TableControlCurrentCellShowingDropDown(object sender, GridTableControlCurrentCellShowingDropDownEventArgs e)
{
GridCurrentCell cc = e.TableControl.CurrentCell;
GridDropDownGridListControlCellRenderer cr = cc.Renderer as GridDropDownGridListControlCellRenderer ;
if( cr != null)
{
cr.ListControlPart.Grid.Refresh();
//Or
cr.ListControlPart.Refresh();
}
}

Let me know if this helps.

Best Regards,
Haneef


PA Pawan Adur December 11, 2006 09:12 AM UTC

Hi haneef ,
yes i am using exactly the same code as sent by you.but still facing the problem.
whenver i change the dropdown values..some times its unable to catch the event..and also shows only 1 value from list whereas there shud be two.

Thanx
Pawan

>Hi Pawan,

Are you using GridListControl celltype in a grid? If so, you can access the GridDropDownGridListControlCellRenderer and use the ListControlPart.Grid.Refresh() method to refresh the grid. Here is a code snippet to show this.

private void gridGroupingControl1_TableControlCurrentCellShowingDropDown(object sender, GridTableControlCurrentCellShowingDropDownEventArgs e)
{
GridCurrentCell cc = e.TableControl.CurrentCell;
GridDropDownGridListControlCellRenderer cr = cc.Renderer as GridDropDownGridListControlCellRenderer ;
if( cr != null)
{
cr.ListControlPart.Grid.Refresh();
//Or
cr.ListControlPart.Refresh();
}
}

Let me know if this helps.

Best Regards,
Haneef


AD Administrator Syncfusion Team December 11, 2006 09:17 AM UTC

Hi Pawan,

Is it possible for you to upload us a small sample or more details to reproduce the issue here? This will help us to analyse the issue further.

Best Regards,
Haneef


JO Joseph December 11, 2006 02:28 PM UTC

Hi Haneef,

Find the needed code below which we wrote for displaying the OPEN?CLOSE values in the dropdown.

public interface ILabelValuePair:IDisposable
{
string Label
{
get;
set;
}
string Value
{
get;
set;
}
}

DataTable workTable = new DataTable("TICKET INFORMATION");

ILabelValuePair labelValuPair = new LabelValuePair();
Type pairColumnType = labelValuPair.GetType();

workTable.Columns.Add("Open/Close", pairColumnType);

//Open-Close Source List
ArrayList openCloseList = new ArrayList();
string[] statusOpenArray = {"OPEN", "OPEN"};
string[] statusCloseArray = {"CLOSE", "CLOSE"};
object[] statusArray = {statusOpenArray, statusCloseArray};
foreach(string[] status in statusArray)
{
ILabelValuePair ocPair = new LabelValuePair();
ocPair.Label = status[0]; ocPair.Value = status[1];
openCloseList.Add(ocPair);
}

//add a new sourcelistset
this.gridNewTicketInfo.Engine.SourceListSet.Add("OpenCloseList", openCloseList);

//add relation descriptor for Open/Close column
relationDescriptor = new GridRelationDescriptor();
relationDescriptor.Name = "Open/Close";
relationDescriptor.MappingName = "Open/Close";
relationDescriptor.ChildTableName = "OpenCloseList";
relationDescriptor.RelationKind = Syncfusion.Grouping.RelationKind.ListItemReference;
relationDescriptor.ChildTableDescriptor.Appearance.AlternateRecordFieldCell.BackColor = Color.Beige;
relationDescriptor.ChildTableDescriptor.VisibleColumns.Add("Label");
relationDescriptor.ChildTableDescriptor.AllowEdit = false;
relationDescriptor.ChildTableDescriptor.AllowNew = false;
relationDescriptor.ChildTableDescriptor.AllowRemove = false;
this.gridNewTicketInfo.TableDescriptor.Relations.Add(relationDescriptor);
relationDescriptor.ChildTableDescriptor.Columns["Label"].HeaderText = "Open/Close";


private void gridNewTicketInfo_TableControlCurrentCellShowingDropDown(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableControlCurrentCellShowingDropDownEventArgs e)
{
GridCurrentCell cc = e.TableControl.CurrentCell;
GridDropDownGridListControlCellRenderer cr =
cc.Renderer as GridDropDownGridListControlCellRenderer;

if(cr != null)
{
cr.ListControlPart.Refresh();
}
}

Regards,
Joseph




>Hi Pawan,

Is it possible for you to upload us a small sample or more details to reproduce the issue here? This will help us to analyse the issue further.

Best Regards,
Haneef


AD Administrator Syncfusion Team December 11, 2006 03:04 PM UTC

Hello Haneef,

Here a picture which shows error, even after having the code you suggested.

Regards,
Joseph

>Hi Haneef,

Find the needed code below which we wrote for displaying the OPEN?CLOSE values in the dropdown.

public interface ILabelValuePair:IDisposable
{
string Label
{
get;
set;
}
string Value
{
get;
set;
}
}

DataTable workTable = new DataTable("TICKET INFORMATION");

ILabelValuePair labelValuPair = new LabelValuePair();
Type pairColumnType = labelValuPair.GetType();

workTable.Columns.Add("Open/Close", pairColumnType);

//Open-Close Source List
ArrayList openCloseList = new ArrayList();
string[] statusOpenArray = {"OPEN", "OPEN"};
string[] statusCloseArray = {"CLOSE", "CLOSE"};
object[] statusArray = {statusOpenArray, statusCloseArray};
foreach(string[] status in statusArray)
{
ILabelValuePair ocPair = new LabelValuePair();
ocPair.Label = status[0]; ocPair.Value = status[1];
openCloseList.Add(ocPair);
}

//add a new sourcelistset
this.gridNewTicketInfo.Engine.SourceListSet.Add("OpenCloseList", openCloseList);

//add relation descriptor for Open/Close column
relationDescriptor = new GridRelationDescriptor();
relationDescriptor.Name = "Open/Close";
relationDescriptor.MappingName = "Open/Close";
relationDescriptor.ChildTableName = "OpenCloseList";
relationDescriptor.RelationKind = Syncfusion.Grouping.RelationKind.ListItemReference;
relationDescriptor.ChildTableDescriptor.Appearance.AlternateRecordFieldCell.BackColor = Color.Beige;
relationDescriptor.ChildTableDescriptor.VisibleColumns.Add("Label");
relationDescriptor.ChildTableDescriptor.AllowEdit = false;
relationDescriptor.ChildTableDescriptor.AllowNew = false;
relationDescriptor.ChildTableDescriptor.AllowRemove = false;
this.gridNewTicketInfo.TableDescriptor.Relations.Add(relationDescriptor);
relationDescriptor.ChildTableDescriptor.Columns["Label"].HeaderText = "Open/Close";


private void gridNewTicketInfo_TableControlCurrentCellShowingDropDown(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableControlCurrentCellShowingDropDownEventArgs e)
{
GridCurrentCell cc = e.TableControl.CurrentCell;
GridDropDownGridListControlCellRenderer cr =
cc.Renderer as GridDropDownGridListControlCellRenderer;

if(cr != null)
{
cr.ListControlPart.Refresh();
}
}

Regards,
Joseph




>Hi Pawan,

Is it possible for you to upload us a small sample or more details to reproduce the issue here? This will help us to analyse the issue further.

Best Regards,
Haneef

errorAgain.zip


AD Administrator Syncfusion Team December 12, 2006 09:21 AM UTC

Hi Joseph,

Use the below code snippet to refresh the DropDownlist in a grid cell.

//TableControlCurrentCellShowingDropDown event handler

GridTableDropDownListCellRenderer cr = e.TableControl.CurrentCell.Renderer as GridTableDropDownListCellRenderer;
if( cr != null)
{
cr.ListControlPart.Grid.Refresh();
}

Please refer to the attached sample for implementation.
ListItemReference_2003.zip


Best Regards,
Haneef


PA Pawan Adur December 22, 2006 04:58 AM UTC


Hi haneef,
even this doesnt work.

>Hi Joseph,

Use the below code snippet to refresh the DropDownlist in a grid cell.

//TableControlCurrentCellShowingDropDown event handler

GridTableDropDownListCellRenderer cr = e.TableControl.CurrentCell.Renderer as GridTableDropDownListCellRenderer;
if( cr != null)
{
cr.ListControlPart.Grid.Refresh();
}

Please refer to the attached sample for implementation.
ListItemReference_2003.zip


Best Regards,
Haneef


AD Administrator Syncfusion Team December 22, 2006 06:02 PM UTC

Hi Pawan,

It would be helpful if you modify the sample in the forum thread to reproduce the issue here. So, we could provide you a better solution at the earliest. If possible post your grid settings. Are you getting any exceptions? Which version of the grid are you using?

Have a nice day.

Best regards,
Madhan

Loader.
Live Chat Icon For mobile
Up arrow icon