Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
60
Ultragrid and DataSource
posted

Hi, I am wondering if there is a better solution to a problem I am currently facing. I am still fairly new to this technology so please don't mind me and I can't seem to find a solution online.

Currently, I have a list of transaction call transactionList in the bussiness object. Starting off, I will have something like this:

private transactionList transactionList1 = null;

Then I through some method, I retrieve the list of transaction and populate the grid. Now I will have something like this:

transactionList1 = transactionList.getTransaction(something, something, something......);

FillGrid(transactionList1);

Now here's the problem... If I want to get something from the transactionList1 and do some changes to my grid I will have to do something like this.

for(){

uGrid.DisplayLayout.Rows[i].Cells[uGrid.ActiveCell.Column.Key].Value = transactionList1.getID();

}

for(){

uGrid.DisplayLayout.Rows[i].Cells[uGrid.ActiveCell.Column.Key].Value = transactionList1.getStartDate();

}

for(){

uGrid.DisplayLayout.Rows[i].Cells[uGrid.ActiveCell.Column.Key].Value = transactionList1.getExpireDate();

}

.

.

.

.....

You get the point. So I am wondering if there is any way I can set this up so I don't have to go through all 50 columns this way. Maybe I can do something to the business object or the DataSource to make things more reusable and robust.

Parents
  • 21795
    Offline posted

    Hello Versus,

    Looking at the code you provided it seems that you are trying to updated or synchronize the values of the data source object with the values in the grid. The question here is why you are trying to do so? As soon as you set the grid’s DataSource any changes you made to DataSource object will be populated to the grid. Keep in mind you may need to call Refresh method over the grid if it is bound to IList object. As long as grid is bound to IBindingList this should not be necessary.

    Therefore, please let me know what the issue you are facing is? Why you need to update or synchronize grid with data source? Also what the type of your DataSource object is?

    Looking forward to your reply.

Reply Children