How to edit a particular cell in listcontrol? - mfc

I am having a listcontrol where I am supposed to edit cell's of second column.
And this should be a list control but not a gridcontrol.
Is it possible to edit cell's of particular column in listcontrol ? If any way exist please let me know how to achieve it.
Any suggestions is appreciated.

Look at CListCtrl::SetItemText
(MSDN)
Use the second parameter to specify the column.

CQuickList, a CListCtrl derived control, allows in-place edit of subitems.

Related

Best way to make a list of rows and column in wxpython with each row having buttons in last column?

I want to make a list of n rows with m columns. Last column must contain a button which on clicking deletes the entire row which that button belongs to.
Click here to see my desired GUI.
I have already looked for wx.grid and didn't get any success.
My questions are
Can this be achieved by using wx.ListCtrl?. If yes then how?
Which is the best wx widget other than wx.grid to achieve this.
Any sample code or illustration will be appreciated.
Thanks

Insert row on top of a qtablewidget

I'll like to know if it's possible to insert a row on top of a qtablewidget ?
Something like:
ui->myqtablewidget->insertRow(0);
Just a heads up - I'm answered based on the documentation and C++
knowledge, not direct experience with Qt.
It would seem that QTableWidget has an insertRow() function. You simply need to specify where you want the row placed. Read the documentation here.
Thus, it would seem from the documentation, you can insert a row at the beginning ("top") of your table with that exact line of code...
ui->myqtablewidget->insertRow(0);
...assuming ui and myqtablewidget are declared properly.

Problems with selection and highlighting in ClistCtrl

I found some problem.
I have class extended from CListCtrl. When I make double click on row I selected it. Everything good, but if I sort some column I have problem!
For example:
I have some row in second position. I selected it and sort column, highlighting is left on second position but my item has moved to 4th row (and selection moved to 4th row)
I have bad feeling that it could be some bug:(
Did somebody see problem like this?
PS: I'm not sure that I have to provide some code, because guess it's ok, but if needs it I will post it
Thank you very much and sorry for my English)
I've only seen this problem with owner data list views (LVS_OWNERDATA) so I'm guessing this is the case here. AFIK there are two possible solutions. The first is to store the selection state yourself and then use LVM_SETCALLBACKMASK to let the control know that you will provide the selection state. You will also have to respond to mouse clicks and update your data array. The other solution is to store a list of selected items before sorting, deselect all items, do the sorting and then finally restore the selection using the stored list.

SharePoint List dropdown/choice (colours)

I would like to know if its possible to have a drop down field/column in SharePoint list that instead of having text choices to select from, the choices are graphics/images (green, red, amber). Or how about having a three divs as choices and each div will have the desired color.
Is any of this possible?
Any suggestion would be appreciated, thanks in advance
I think you cant provide color coding to the choice filed directly
but there is one way to do something similar to this.
please look at this link
http://www.vishalseth.com/post/2008/11/02/Adding-Color-Columns-to-Sharepoint-lists.aspx
In this it will get the color by using calculated field value. you can customize this as per your requirement
Let me the outcome as i m also eager to know this
Thanks

MFC CListCtrl updating text of any cell

This question is to understand how to update any row programatically.
Details.
I have a listcrtl, that accepts the data from either from a file or from the edit controls in the dialog. When the items are added I will know its position, that I added, so I can change its subitem texts. I have even implemented the sort functionality in the list, so now the position keeps changing. I have an identifier column for each row, so that I can recognize the row.
Now, from an out side event, if I have to change an other columns value of an ID that I know , I have to first find the position of the item by comparing the id column, then with that position, I have set the subitemtext.
This works fine except that it takes time to find the row first then it need to update the column.
Now, in order to get the row directly, I need some help.
I have gone through
http://msdn.microsoft.com/en-us/library/windows/desktop/hh298346(v=vs.85).aspx
But this does not use MFC. Please help me achieving this.
If you have many items you should consider switching to Virtual Lists. It is the fastest way to access the data. If you do not want to invest time to this, then the easiest way for you will be the following:
When you populate the CListCtrl store the ID of each item in the item data using the SetItemData() method. The ID will always be associated with the item, even after re-sorting.
When you need to locate the required item, just scan all items, but do not use GetItemText(). Use GetItemData() instead. This will be faster