• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2310
  • Last Modified:

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

0
Adnan
Asked:
Adnan
  • 5
  • 3
1 Solution
 
AdnanAuthor Commented:
?
0
 
Priest04Commented:
In order to create a custom property, you would need to create a CustomDataGridViewRow that inherits from DataGridViewRow. You could use Tag property instead.
0
 
AdnanAuthor Commented:
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?
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
AdnanAuthor Commented:
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.
0
 
Priest04Commented:
You would add new class called CustomDataGridView and inherit from DataGridView control. Then you would add new property

Then you would need to add this control on a form instead of DataGridView. If you want to replace existing one, go to the form designer window and replace DataGridView with CustomDataHridView manually in code.

I still understand why don't you use DataGridViewRow.Tag property to flag it?
0
 
AdnanAuthor Commented:
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";
               
            }
         
         

        }
0
 
AdnanAuthor Commented:
??
0
 
Priest04Commented:
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?
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 5
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now