Link to home
Start Free TrialLog in
Avatar of Adnan
AdnanFlag for Norway

asked on

How to set flag/bookmark on to datagridview rows......

hi

i want to make a simple function to set flag on my datagridview rows. Datagridview is containing a lots of transactions and i want to make function to set flag on transaction i want to set flag on...?!
private void FlagTransactions()
        {
            //MoneyDBDataSet.CountriesRow row = countries[0] as MoneyDBDataSet.CountriesRow;
            //DsReconItems.MatchItemRow[] drows = (DsReconItems.MatchItemRow[])dsReconItems1.MatchItem.Select("Reconciled_ID = " + kPair.Key.ToString());
            DataGridViewRow row = ReconManuallyGridView.CurrentRow;
            int flagColIndex = ReconManuallyGridView.Columns["Amount"].Index;
            DataGridViewCell cell = ReconManuallyGridView.CurrentRow.Cells[flagColIndex];
            cell.Value = row.Flag;
            
        }

Open in new window

Avatar of Adnan
Adnan
Flag of Norway image

ASKER

?
In order to create a custom property, you would need to create a CustomDataGridViewRow that inherits from DataGridViewRow. You could use Tag property instead.
Avatar of Adnan

ASKER

Hmm oki, i dident understand how to create a custom property, and i have searched alot on google to find out how to set mark/flag/ or bookmar a row, but there no good samples out there.... :(

Can somone help me with this?
Avatar of Adnan

ASKER

My problem is that I need to allow the user to bookmark a specific row and then easily return to that row after scrolling through the grid.
ASKER CERTIFIED SOLUTION
Avatar of Priest04
Priest04
Flag of Serbia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Adnan

ASKER

Hi Priest04:


 I want ability to bookmark so that you can jump between the bookmarked transactions, and mark one or several transactions with colour a flag like in outlook

and i dided as you was saying by using property Tag

 private void FlagTransactions()
        {
           
            foreach (DataGridViewRow dr in ReconManuallyGridView.Rows)
            {
                dr.Tag = "Michael Sync";
               
            }
         
         

        }
Avatar of Adnan

ASKER

??
gonadn, it seems that you expect that we sit here and wait to answer to someone's question. Most of us here work, too, so you need to be patient.

I do not understand what exactly are you trying to do. I don't use Outlook so I am not aware of its options. The code you have written will work. So, what is it that troubles you?