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.
Unfortunately, activation email could not send to your email. Please try again.

Grouping Grid Cell DropdownList not refreshing the correct contents.

Thread ID:

Created:

Updated:

Platform:

Replies:

53060 Dec 7,2006 09:48 AM Dec 22,2006 01:02 PM Windows Forms 10
loading
Tags: Grouping
Joseph
Asked On December 7, 2006 09:48 AM

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

Administrator [Syncfusion]
Replied On December 8, 2006 05:49 AM

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

Pawan Adur
Replied On December 11, 2006 02:53 AM

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

Administrator [Syncfusion]
Replied On December 11, 2006 03:53 AM

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

Pawan Adur
Replied On December 11, 2006 04:12 AM

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

Administrator [Syncfusion]
Replied On December 11, 2006 04:17 AM

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

Joseph
Replied On December 11, 2006 09:28 AM

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

Administrator [Syncfusion]
Replied On December 11, 2006 10:04 AM

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

Administrator [Syncfusion]
Replied On December 12, 2006 04:21 AM

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

Pawan Adur
Replied On December 21, 2006 11:58 PM


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

Administrator [Syncfusion]
Replied On December 22, 2006 01:02 PM

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

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;