Kanhialal kk

Kanhialal kk

  • NA
  • 234
  • 339.3k

reterieve the DataRow in focused column instead of series in FLexGird

May 14 2011 6:16 AM
Hi..

I am working on AxMSFlexGridLib as a Girdview, also I have taken a combobox in my application. Now I want to put the data into  AxMSFlexGridLib where Id=Combox.
but problem is that I want to set the data where row is focused in AxMSFlexGridLib.

and i did code as:

private void workercombo_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                if (!this.check)
                {
                    this.check = true;
                }
                else
                {
                    this.combo1.SelectedIndex = this.workercombo.SelectedIndex;
                    this.lblname2.Text = this.combo1.Text;
                    this.combo2.SelectedIndex = this.workercombo.SelectedIndex;
                    for (int i = 1; i<flex1.Rows; i++)
                    {
                        for (int j = 1; j < this.flex1.Cols; j++)
                        {
                            if ((this.flex1.get_TextMatrix(i, 5).Length == 0) && ((this.flex1.get_TextMatrix(i, 4).Length > 0) || (this.flex1.get_TextMatrix(i, 8).Length > 0)))
                            {
                                this.flex1.set_TextMatrix(i, 5, Convert.ToString(this.workercombo.Text));
                                this.flex1.set_TextMatrix(i, 6, this.lblname2.Text);
                                this.flex1.set_TextMatrix(i, 7, Convert.ToString(this.combo2.Text));                      
                               
                                return;
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message,"Error!");
            }
        }

but this is working in a series one by one from top to bottom while my requirement is to set the data on focused row. or selected row.

any person help..


Answers (5)