Skip to content

Replies

0
Pradeep
Pradeep answered on Nov 14, 2008 10:19 AM

 Hi,

It is giving Column header as Row '0' and 1st row also as row '0'. 

 Please help me out. Its urjent requirement. How to catch whether mouse is clicked on column  header or not( I need to sort the column when i click on column header).

 

regards,

Pradeep 

 

 

0
Pradeep
Pradeep answered on Nov 14, 2008 7:36 AM

Hi,

I am having some doubt regarding GetContext. I am using this method to get the row and column on mouse move. please find the sample code below.

Infragistics.Win.UIElement aUIElement;
                aUIElement = ultraGrid1.DisplayLayout.UIElement.ElementFromPoint(new Point(e.X, e.Y));
                UltraGridRow tRow;
                UltraGridColumn tCol;
                tCol = (UltraGridColumn)aUIElement.GetContext(typeof(UltraGridColumn));
                tRow = (UltraGridRow)aUIElement.GetContext(typeof(UltraGridRow));

                    int lRow = tRow.Index;
                    int lCol = tCol.Index; 

 

Its working fine. But when i place my mouse on Column header, it is giving row number(lRow) as '0'. 

 

0
Pradeep
Pradeep answered on Nov 13, 2008 12:11 PM

 Hi,

I got the Solution for this.

Regards,

Pradeep. 

 

0
Pradeep
Pradeep answered on Nov 12, 2008 2:58 PM

Hi, I am
using the GetCellValue in the following way. I am able to get the value of a
cell(where mouse points).

 

But i am
having requirement like, i know the row number and column number, I want to get
the value in that cell.

I have
tried in so many ways. But I am unable to find the answer. So Please help me.
Thanks in advance.

Please find the sample code below. 

 

private
void ultraGrid1_MouseMove(object sender, MouseEventArgs e)

        {

            int lCol = 0;

            int lRow = 0;

            int absPos = 0;

 

            Infragistics.Win.UIElement
aUIElement;

            aUIElement =
ultraGrid1.DisplayLayout.UIElement.ElementFromPoint(new Point(e.X, e.Y));

            UltraGridRow tRow;

            UltraGridColumn tCol;

            tCol = (UltraGridColumn)aUIElement.GetContext(typeof(UltraGridColumn));

            tRow =
(UltraGridRow)aUIElement.GetContext(typeof(UltraGridRow));

            // 
if a row was found display the band and row index

            if (!(tRow == null))

            {

                lRow = tRow.Index + 1;

               
//MessageBox.Show(tRow.Index.ToString());

            }

            else

            {

                //MessageBox.Show("No row
or column associated");

            }

            if (!(tCol == null))

            {

                lCol = tCol.Index + 1;

                //MessageBox.Show("Col=" +
tCol.Index.ToString());

            }

 

 

            //Wingrid

            if (mCurrentSampleObj != null)

            {

                absPos =
(int)mCurrentSampleObj.get_AbsolutePosition();

                if (lCol > 1 && lRow
> 0)

                {

          string ToolTipText =
tRow.GetCellValue(tCol).ToString();  
// Gets the text where
mouse points(Cell pointed by mouse).

  // But here i want to get the value of particular cell(specified
column given by us. For example Column =4, Row number will be the same as given above)

                    toolTip1.SetToolTip(ultraGrid1,
ToolTipText);  

 

//arow.Index = lRow-1;

                    //toolTip1.SetToolTip( ultraGrid1,
arow[COL_DESCRIPTIONS – 1].ToString());

                }

                else if (lCol == 1 &&
lRow > 0)

                {

                   
toolTip1.SetToolTip(ultraGrid1, severityImage);

                }

                else

                {

                   
toolTip1.SetToolTip(ultraGrid1, "");

                }

            }

            TEMSDatabaseBOM.SAMPLEPOSITION
tempint = (TEMSDatabaseBOM.SAMPLEPOSITION)absPos;

            mCurrentSampleObj.set_AbsolutePosition(ref
tempint);

}