Any trick to edit any colmun in a TListview control report mode? [Edit]

I  mean every subitems from the list (report mode), not just the caption, editing done within the list itself. Or any third-party TListView derived from Delphi TListView that do allow it (not TVirtualStringTree).  Thanks.
0
richard
4/15/2009 7:04:50 PM
embarcadero.delphi.vcl.using 2297 articles. 2 followers. Follow

12 Replies
1701 Views

Similar Articles

[PageSpeed] 48
Get it on Google Play
Get it on Apple App Store

<richard poulin> wrote in message news:104692@forums.codegear.com...

> I  mean every subitems from the list (report mode), not just the caption,
> editing done within the list itself.

How to use the Build-in Editor of TListView to Edit SubItems
http://cc.embarcadero.com/Item/23873

-- 
Remy Lebeau (TeamB)
0
Remy
4/15/2009 7:37:37 PM
> {quote:title=Remy Lebeau (TeamB) wrote:}{quote}
> <richard poulin> wrote in message news:104692@forums.codegear.com...
> 
> > I  mean every subitems from the list (report mode), not just the caption,
> > editing done within the list itself.
> 
> How to use the Build-in Editor of TListView to Edit SubItems
> http://cc.embarcadero.com/Item/23873
> 
> -- 
> Remy Lebeau (TeamB)

That's it. Thank.
0
richard
4/17/2009 7:57:38 PM
On Wed, 15 Apr 2009 12:37:37 -0700, Remy Lebeau (TeamB)
<no.spam@no.spam.com> wrote:

><richard poulin> wrote in message news:104692@forums.codegear.com...
>
>> I  mean every subitems from the list (report mode), not just the caption,
>> editing done within the list itself.
>
>How to use the Build-in Editor of TListView to Edit SubItems
>http://cc.embarcadero.com/Item/23873

Looks like a lot of Form level code...
Isn't there something one can do to the component itself so this
behaviour will be available everywhere one uses the TListView?

Like making a TMyListview = class(TlistView) with some changes like:
Event for the subitem click:

OnSubItemClick(Sender: Tobject; Item: TListItem; Index, ColumnIndex:
integer);

This would indicate the exact subitem clicked and can be used to
transfer its contents into an editbox on the side of the list
(spreadsheet style).

A decendant of TListView with the added event as above and also some
kind of property AllowSubItemEdit that if set makes the clicked
subitem editable would really be useful.

--

Bo Berglund
Developer in Sweden
0
Bo
4/19/2009 10:53:50 PM
> {quote:title=Bo Berglund wrote:}{quote}
> On Wed, 15 Apr 2009 12:37:37 -0700, Remy Lebeau (TeamB)
> <no.spam@no.spam.com> wrote:
> 
> ><richard poulin> wrote in message news:104692@forums.codegear.com...
> >
> >> I  mean every subitems from the list (report mode), not just the caption,
> >> editing done within the list itself.
> >
> >How to use the Build-in Editor of TListView to Edit SubItems
> >http://cc.embarcadero.com/Item/23873
> 
> Looks like a lot of Form level code...
> Isn't there something one can do to the component itself so this
> behaviour will be available everywhere one uses the TListView?
> 
> Like making a TMyListview = class(TlistView) with some changes like:
> Event for the subitem click:
> 
> OnSubItemClick(Sender: Tobject; Item: TListItem; Index, ColumnIndex:
> integer);
> 
> This would indicate the exact subitem clicked and can be used to
> transfer its contents into an editbox on the side of the list
> (spreadsheet style).
> 
> A decendant of TListView with the added event as above and also some
> kind of property AllowSubItemEdit that if set makes the clicked
> subitem editable would really be useful.
> 
> --
> 
> Bo Berglund
> Developer in Sweden

Yes that will be a good idea. May be TAdvListView from TMS does it? 

Originally i used InputQuery...

Something like this:

// modify any items in TListView - Report mode: 
procedure TForm1.ModifySubItemClick(Sender: TObject);

var
   s, s1: string;

begin
s :=Listview1.Items.Item[Listview1.ItemIndex].Caption;
s1 := s;
InputQuery('Protocole', '', s1);
Listview1.Items.Item[Listview1.ItemIndex].Caption := s1;

s := Listview1.Items.Item[Listview1.ItemIndex].SubItems[0];
s1 := s;
InputQuery('Adresse IP Source', '', s1);
Listview1.Items.Item[Listview1.ItemIndex].SubItems[0] := s1;

.....
 
Indeed, not very smart !
0
richard
4/19/2009 11:57:16 PM
On Wed, 15 Apr 2009 12:37:37 -0700, Remy Lebeau (TeamB)
<no.spam@no.spam.com> wrote:

><richard poulin> wrote in message news:104692@forums.codegear.com...
>
>> I  mean every subitems from the list (report mode), not just the caption,
>> editing done within the list itself.
>
>How to use the Build-in Editor of TListView to Edit SubItems
>http://cc.embarcadero.com/Item/23873

I tried this on my own form but it failed miserably....

Here are just a few of the depressingly many errors generated (line
numbers added to lines for reference to error list below):

function GetComCtl32Version: DWORD;
type
(70)  DLLGETVERSIONPROC = function(var dvi: DLLVERSIONINFO): Integer;
stdcall;
(71)  DLLVERSIONINFO = packed record
    cbSize: DWORD;
    dwMajorVersion: DWORD;
    dwMinorVersion: DWORD;
    dwBuildNumber: DWORD;
    dwPlatformID: DWORD;
  end;
var
  hComCtrl32: HMODULE;
  lpDllGetVersion: DLLGETVERSIONPROC;
  dvi: DLLVERSIONINFO;
(82)  FileName: array[MAX_PATH+1] of Char;
(83)  dwHandle: DWORD;
(84)  dwSize: DWORD;
  pData: Pointer;
  pVersion: Pointer;
  uiLen: UINT;
begin
  if ComCtl32Version = 0 then
  begin
    hComCtrl32 := GetModuleHandle('comctl32.dll');
(92)    if hComCtrl32 <> nil then
    begin
(94)      @lpDllGetVersion = GetProcAddress(hComCtrl32,
'DllGetVersion');
      if @lpDllGetVersion <> nil then
      begin
(97)        FillChar(@dvi, SizeOf(dvi), 0);
        dvi.cbSize = SizeOf(dvi);
        if lpDllGetVersion(dvi) >= 0 then
          ComCtl32Version := MAKELONG(Word(dvi.dwMajorVersion),
Word(dvi.dwMinorVersion));
      end;
      if ComCtl32Version = 0 then
      begin
        FillChar(FileName, SizeOf(FileName), 0);
        if GetModuleFileName(hComCtrl32, FileName, MAX_PATH) <> 0 then
        begin
          dwHandle := 0;
          dwSize := GetFileVersionInfoSize(FileName, dwHandle);
          if dwSize <> 0 then
          begin
            pData := LocalAlloc(LPTR, dwSize);
            if pData <> nil then
            begin
              if GetFileVersionInfo(FileName, dwHandle, dwSize, pData)
then
              begin
                pVersion := nil;
                uiLen := 0;
                if VerQueryValue(pData, '\', pVersion, uiLen) then
                begin
                  with PVSFixedFileInfo(pVersion)^ do
                    ComCtl32Version := MAKELONG(Word(dwFileVersionMS),
Word(dwFileVersionLS));
                end;
              end;
              LocalFree(pData);
            end;
          end;
        end;
      end;
    end;
  end;
  Result := ComCtl32Version;
end;

List of errors:
===============
[Error] FormCompareLeads.pas(70): Undeclared identifier:
'DLLVERSIONINFO'

[Error] FormCompareLeads.pas(71): Identifier redeclared:
'DLLVERSIONINFO'

[Error] FormCompareLeads.pas(82): '..' expected but ']' found

[Error] FormCompareLeads.pas(83): Constant expression expected
[Error] FormCompareLeads.pas(83): ',' or ':' expected but ';' found

[Error] FormCompareLeads.pas(84): Constant or type identifier expected

[Error] FormCompareLeads.pas(92): Operator not applicable to this
operand type

[Error] FormCompareLeads.pas(94): ':=' expected but '=' found

[Error] FormCompareLeads.pas(97): Constant object cannot be passed as
var parameter

And the list just goes on and on with a ton of errors! Can't copy them
all into this post. :-(

I have checked the uses clauses but the one in the example and the one
on my form correspond (I have all the units you have listed).

So what is the problem here, really? Was this tested at all?

BTW: I am using Delphi 7 Professional, does this matter????

--

Bo Berglund
Developer in Sweden
0
Bo
4/20/2009 7:53:43 AM
Bo


Possibly a silly question, but if you're using it with ViewStyle = vsReport why not use a stringgrid, either Delphi's own or any of the much prettier options out there?

Roy Lambert
0
Roy
4/20/2009 8:43:36 AM
On Mon, 20 Apr 2009 01:43:36 -0700, Roy Lambert
<roy.lambert@skynet.co.uk> wrote:

>Bo
>
>
>Possibly a silly question, but if you're using it with ViewStyle = vsReport 
>why not use a stringgrid, either Delphi's own or any of the much prettier 
>options out there?
>
>Roy Lambert

I've never used a striggrid except I once or twice looked at it and it
looks so ugly...
Also the height of the rows is at least twice as much as the Listview
and since I have a *lot* of rows such things matter. In one list
currently there is 15.000 rows and 30 columns, and I can see a lot on
each screenful. The stringgrid seems to be able to only show about
half as much as the listview...

But I'll have a look at it again and see if it might be a good
replacement anyway.

How do I find the "much prettier" ones "out there"?

Thanks for the pointer.
 
--

Bo Berglund
Developer in Sweden
0
Bo
4/20/2009 10:35:43 AM
Bo

>I've never used a striggrid except I once or twice looked at it and it
>looks so ugly..

Agreed
...
>Also the height of the rows is at least twice as much as the Listview
>and since I have a *lot* of rows such things matter. In one list
>currently there is 15.000 rows and 30 columns, and I can see a lot on
>each screenful. The stringgrid seems to be able to only show about
>half as much as the listview...

Look at DefaultRowHeight and Options.goVertLine and Options.goHorzLine

>But I'll have a look at it again and see if it might be a good
>replacement anyway.
>
>How do I find the "much prettier" ones "out there"?

www.tmssoftware.com
www.devexpress.com

These will have their own built in editors

Also have a look on www.torry.net - there may be a freebie that will do what you want

Roy Lambert
0
Roy
4/20/2009 11:13:37 AM
On Mon, 20 Apr 2009 03:35:43 -0700, Bo Berglund wrote:

> How do I find the "much prettier" ones "out there"?

You could try virtual tree view.
http://www.soft-gems.net/index.php?option=com_content&task=view&id=12&Itemid=33

-- 
Marc Rohloff [TeamB]
marc -at- marc rohloff -dot- com
0
Marc
4/20/2009 12:32:13 PM
About: http://cc.embarcadero.com/Item/23873
----------------------
I can not compile either using Delphi 2007 / Delphi 2009. (D5 looks OK).  

Third Party Test:

DevExpress ListView : has no built in editor as far as i can see.  
TMS advListView: has built in editor and individual cell selector in report mode (press F2 on the selected cell to edit).
0
richard
4/20/2009 3:04:31 PM
On Mon, 20 Apr 2009 08:04:31 -0700, richard poulin <> wrote:

>About: http://cc.embarcadero.com/Item/23873
>----------------------
>I can not compile either using Delphi 2007 / Delphi 2009. (D5 looks OK).  

And I can't compile using Delphi 7 Pro....
Seems like it cannot be done at all, so I will start looking at the
TStringGrid replacements available on the net instead...

>Third Party Test:
>
>DevExpress ListView : has no built in editor as far as i can see.  
>TMS advListView: has built in editor and individual cell selector in report mode (press F2 on the selected cell to edit).

--

Bo Berglund
Developer in Sweden
0
Bo
4/20/2009 4:59:45 PM
"Bo Berglund" <bo.berglund@nospam.com> wrote in message 
news:106560@forums.codegear.com...

> Looks like a lot of Form level code...
> Isn't there something one can do to the component itself so
> this behaviour will be available everywhere one uses the
> TListView?

ListView controls simply do not natively support editing sub-items inlined, 
so the edit control has to be manipulated manually on a per-ListView basis.

> Like making a TMyListview = class(TlistView) with some changes like:
<snip>
> A decendant of TListView with the added event as above and also some
> kind of property AllowSubItemEdit that if set makes the clicked
> subitem editable would really be useful.

I had considered wrapping my code in such a descendant before, but I just 
don't have any time to implement it myself.  I'm already years behind in 
releasing new versions of my existing components.

-- 
Remy Lebeau (TeamB)
0
Remy
4/20/2009 7:14:38 PM
Reply:

Similar Artilces:

Error: "Query: dataset not in Edit mode": in delphi code for Rave Report [Edit]
I am trying to write a Delphi code (Delphi 2010) to print a rave report from the access database; I am using RVSystemprint method; q1 is a query name. I get error message " q1: dataset not in edit or insert mode", at the line: while not q1.Eof. Even though I added q1.Edit or q1.insert, it doesn't work. Database's readonly property is FALSE. What is missing in the code? Thanks. procedure TForm1.rsysPrint(Sender: TObject); begin with Sender as TBaseReport do begin ..... q1.Open; q1.Edit; q1.first; while not q1.Eof do begin ... end; .... ...

Edit control is not loaded in edit mode
I have a problem that the dynamic data field edit control (such as TEXT_edit.ascx) is not loaded when in edit mode. Instead, the normal view control is loaded (such as Text.ascx). In debug I can determina the page mode is truly edit mode. Please help! Could you provide some more context: is this in a custom page with a custom column set or one of the default scaffold pages? Are you using a UIHintAttribute? Make sure the names of the display and edit versions match.Marcin DoboszSDE, ASP.NET Team, MicrosoftRead my blog This is just a thought are you using Views rather than ...

"Using other editions of SQL Server for report data sources and/or the report server database" is not supported in this edition of Reporting Services
Hi My project is in .NET 2003 i.e. framework 1.1 and database in SQLServer 2000. But the reports have been developed using SQLServer 2005 Reporting Services. Now when I am trying to deploy them through deployment project of .NET its giving me following error:"Using other editions of SQL Server for report data sources and/or the report server database" is not supported in this edition of Reporting Services.  Now I am really confused with this. Can any one please guide me regarding this ASAP. Thanks, Falguni    You will need to use the SQL Server ...

Edit a DataControl (without using Edit Mode)
Hi is it possible to edit a data control (i will use datalist or detailsview) with clicking a linkbutton (not data control's edit mode) ? my link button in a division and my data control is in another division so i think i have to find a solution to change my datacontrol's mode to edit with clicking a button. A simple example  <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default4.aspx.cs" Inherits="Default4" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xh...

Add new controls to a gridview row; when editing that row using the edit row feature in the gridview control.
Hi all  I have a questions that looks hard / complex to me, and i know you can help me in this. Q {  I have row in a Gridview and i have an edit option to it. I press the edit button, to edit the values in that row and update data all the way back to the database. Now when i press the edit button, i want a drop down list to be displayed that contain values for a particular field in my grid view. (for now only plain text boxes appear.) } I hope you understand my question, all i need to do is replace the text box controls with a dropdown list when i am editing a row in ...

To edit or no to edit
Jon, Can I edit, whatever I've written so far, so that it doesn't look like I wrote utterly crap?-) -- Pieter "Linux is like living in a teepee. No Windows, no Gates, Apache in house." -- Usenet signature Pieter Zijlstra wrote: > Jon, > > Can I edit, whatever I've written so far, so that it doesn't look like > I wrote utterly crap?-) Oh boy, the edit button vanished from the web-forum ... ;-) -- Pieter "Humor is also a way of saying something serious." -- T. S. Eliot (1888 - 1965) Pieter Zijlstra wrote: ...

Edit but no edit
I've Created a custom module and reuse the survey.dnn file to help with the install here it is. <?xml version="1.0" encoding="utf-8" ?> <dotnetnuke version="2.0" type="Module"> <folders> <folder> <name>CompanyName - Photos</name> <description>Photos allows you to add photo albums</description> <version>01.00.00</version> <modules> <module> <friendlyname>CompanyName - Photos</friendlyname> <controls> <c...

Editable/Not Editable
Hello All, I have some webform(.aspx page) in which i have some controls (for input) and i would like to make that screen editable/not editable based on some condition. how can i do that.  the whole intent is user can read the information but can't change.  shiva kumar If you want to make the controls editable/non-editable, you can set their ReadOnly property to true or false accordingly. What exactly do you imply by making the screen editable/non-editable?Thanks,MaxLet Me Google That For You! i mean to say i would like to show the current values but user should not mod...

GridView control enters edit mode only when I click Edit link twice
Hi all..I have a GridView control in an ASP.NET 2.0 page. I added a column that contains edit, update, cancel buttons. Because I did that, I had to handle RowEditing event or an exception was thrown.Well... this is the body of the RowEditing event:protected void gvParametros_RowEditing(object sender, GridViewEditEventArgs e){      gvParametros.EditIndex = e.NewEditIndex;}The fact is that when page is loaded and I click the edit link, page is refreshed but GridView doesn't enter edit mode. When I press edit link again, GridView enters edit mode.Any help to solve this behavior w...

ANN: Delphi HTML Reports preview
Very simple to use - buid complex reports in 10 minutes. All you need to know - SQL, HTML, CSS. Use all power of HTML4 and CSS3 in any part of report. Features: Barcodes Multiline headers Groups Cross-tabs (any level) Transformations (cross-tab with range) Pictures (+from database) Master/Detail (any level) Supports all databases and db-libraries (writing adapter for any db-acess library takes only 5 minutes) Standalone reports - no need for delphi forms/datasets. 100% native Delhi code. All Delphi versions - from Delphi 6 to XE6 (VCL). 32/64 bit. Supports Unicode for...

Gridview Edit go to new page and enter Edit mode on a formview control.
Okay, so far I have the edit button go to a page called update.aspx. And have the ID selected. However, I don't want it to be in selected view, I want it to go to the update.aspx page in edit mode not selected mode. Is this possible? You can add one hyperlink and set its path to update.aspx?Id=(selectedId)on update.aspx read Id's value from querystring and do updation - Hardik (Software Developer,Surat,India)Please remember to click "Mark as Answer" on this post if it helped you. You lost me at the "do updation part" so far I have a the EDIT link go to ...

Problem using InstallAware 7 CodeGear Special Edition with Delphi 2010 [Edit]
Hi Everyone, I am trying to create an installation disk for my delphi 2010 application using the installAware that kind of comes with Delphi 2010. When I try to built it, it keeps giving me the error message:- No files matching pattern "C:\Windows\system32\\*120.bpl" and when I look into my windows\system32 folder, there the files with extension *.bpl end with *140.bpl and not *120.bpl like it was expected. Can anyone tell me if I am doing something wrong or how I can get around this. Thanks in advance. Edited by: Tat Hon Chu on Dec 3, 2009 12:55 AM > {quo...

IWDBEdit control set to IWDBGridColumn.Control not editable [Edit]
Hi folks. I'm relatively new to IntraWeb and am having trouble with my application. It is a simple app that is supposed to show a list of user accounts in a grid and allow the user to edit data in the accounts. I have a TADOQuery connecting to MS SQL, with 'Select * from UserAccounts' as the sql text. I have a TDataSource with the Dataset property pointing to my TADOQuery object. Both of these objects exist as part of the UserSession. On my main form, I have an IWDBGrid, IWDBNavigator, and an IWDBEdit control. They are all hooked up to the TDatasource in the UserSessi...

Custom control
 I created a custom control class like following! When in normal mode it's a div and when in edit mode it is a dropdownlist! 1 public class Label2DropDown : BoundField2 {3 private string dropMember;4 public string DropMember5 {6 get { return dropMember; }7 set { dropMember = value; }8 }9 10 ///<summary>11 ///Builds the contents of the field12 ///</summary> 13 protected override void InitializeDataCell(DataControlFieldCell cell, DataControlRowSta...

Web resources about - Any trick to edit any colmun in a TListview control report mode? [Edit] - embarcadero.delphi.vcl.using

Blogs
FireMonkey’s underlying visual control architecture has been significantly overhauled in XE8 to enable multiple presentation implementations ...

Use AnsiString And UTF8String In Delphi XE5 Firemonkey On Android And IOS
Embarcadero disabled access to byte stings in Delphi XE5 Firemonkey and if you're a long time Delphi developer you may be missing them. They ...

Turbo Vision port to the GNU compiler and more - History
Turbo Vision port to the GNU compiler and more

Blogs
Get Latest Updates On Embarcadero Products And News Information. Embarcadero Community Blog Also Discuss About The Code Samples And Snippets. ...

Contact - Delphi XE5 XE6 XE7 XE8 Firemonkey, Delphi Android, Delphi IOS
Skip to content Search for: Firemonkey eXplorer Program FMXFeeds FMXDemos FMXUniversity Submit Story Search Search for: Contact Name (required) ...

Resources last updated: 1/5/2016 3:56:57 PM