When refreshing the contents of DataGridView, it's not remembering the DataGridViewCheckBox if clicked - C# -


basically, when add new task list , display it, works fine , code used add new task , display set of tasks:

add task code on addtask.cs:

    taskstructure.tasksarray.add(new taskstructure     {         taskid = taskidvaluetxt.text,         taskname = tasknamertb.text,         taskdescription = taskdescrtb.text,         taskpriority = checkedbutton,         taskdateandtimecompletion = finishdateandtimedtp.text,         taskcompleted = mainpage.testerrr      }); 

testerrr public static bool trying use value selected via user in datagridviewcheckboxcell each task, did not work using

testerrr = convert.toboolean(((tasksviewerdgv.rows[i].cells["taskcompleted"] datagridviewcheckboxcell).value)); 

display task code on mainpage.cs

    //change null list<t> datagridview can update new , current task values     taskstructurebindingsource.datasource = null;     taskstructurebindingsource.datasource = taskstructure.tasksarray; 

basically if user marks task completed, want value stay particular task e.g true. however, when refresh datagridview, 'ticked' values changed false (unticked). there anyway when click checkbox task make stay checked when refresh?

kieran

set dataproperty of datagridviewcheckboxcolumn "taskcompleted" bind values of column taskcompleted property of taskstructure objects.


Comments

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -