Displaying details in popuptextbox/Multiline textbox on ultragrid Editbutton click event

This post has 20 Replies | 6 Followers

Points 92
shwethch
Replied On: Tue, Sep 23 2008 6:21 PM

I have added a column in ultrawingrid and set the style to ColumnStyle.EditButton.In the cell am displaying data from the database.as the data is too long to  display in the cell, when the user clicks on the edit button of the cell,i need to display in a popup kind of control(may be multi line textbox).

Please suggest me how can i implement this functionality.

 

~shwetha
  • Post Points: 20
Replied On: Wed, Sep 24 2008 10:31 AM

Hi,

It might be possible to do this with an EditButton, but it would be much easier with an EditorButton. The distinction is pretty subtle, but they are two totally different things. 

Here's what you do: 

  • Don't change the Style of the column, leave is set to default. 
  • Place an UltraTextEditor control on the form with the grid.
  • Use the ButtonsRight collection to add a DropDownEditorButton to the UltraTextEditor.
  • Set the Control property of this button to whatever control you want dropped down. You can use a TextBox or another UltraTextEditor or maybe an UltraFormattedLinkLabel or UltraFormattedTextEditor if you want to get fancy.
  • Set the EditorControl property of the grid column to the UltraTextEditor.

That's it. Instant dropdown textbox in a grid cell.

You will probably want to handle the AfterEditorButtonDropDown event of the UltraTextEditor and use the e.Context to determine which grid cell is dropping down and then populate the dropdown control accordingly. 

 

Mike Saltzman

Manager - Windows Forms Development

Infragistics, Inc.

  • Post Points: 115
Points 92
shwethch
Replied On: Wed, Sep 24 2008 5:56 PM

Thnx Mike ,it helped me solving my problem like in 2 mins.Thnq once again.

~shwetha
  • Post Points: 5
Points 520
exploitit
Replied On: Thu, Jan 6 2011 7:36 AM

Hi all, I know this is an old question I know, but is it at all possible to make the editor textbox (the one that's being dropped down), resizeable? I think I'm either missing something obvious or it's not easily possible.

Thanks, Tom

  • Post Points: 20
Replied On: Thu, Jan 6 2011 12:07 PM

Hi Tom,

Resizable dropdowns is a new feature we just recently added. I beleive it was added in NetAdvantage v10.2.

So if you are user that version (or higher), you can make the dropdown resizable by setting the DropDownResizeHandleStyle property on the DropDownEditorButton.

Mike Saltzman

Manager - Windows Forms Development

Infragistics, Inc.

  • Post Points: 20
Points 520
exploitit
Replied On: Fri, Jan 7 2011 5:09 AM

Thanks Mike! Yet another reason Infragistics is the best toolkit out there!

Erm one thing though it doesn't appear to work (in 10.2). Is it something to do with the fact it's called from an UltraGridCell? The editor I'm dropping down is an UltraTextBox that's been set to True for MultiLine, AcceptsTab and WordWrap is defaulted to True. Also scrollbars are disabled just in case.

UPDATE: I knocked up a test harness to see if it was indeed the cell, and editor alone shows the expansion area, whereas if it's dropped from a cell it doesn't show it

Thanks, Tom

Here are some pics

And one from the cell itself:

  • Post Points: 20
Replied On: Fri, Jan 7 2011 10:04 AM

I don't see anything wrong with your code. It's possible that this is a bug that was fixed. Try getting the latest service release and see if that helps:

How to get the latest service release - Infragistics Community

If that does not help, post your sample project here (you can attach a zip file under the Options tab) and I will take a look.

Mike Saltzman

Manager - Windows Forms Development

Infragistics, Inc.

  • Post Points: 20
Points 520
exploitit
Replied On: Fri, Jan 7 2011 11:17 AM

Ok I downloaded the latest version (10.3) and tried that. No luck here. I must have missed an obvious property or something. I've attached the project (for 10.3, I'll have to use 10.2 though for our main project) that I screenshotted earlier.

Thanks for your help, Tom

  • Post Points: 35
Replied On: Mon, Jan 10 2011 9:48 AM

Hi Tom, 

If you are missing something obvious, then I must be missing it, too. This looks like it should be working. I think there's probably a bug here. It looks to me like the DropDownResizeHandleStyle on the button is not getting copied from the button in the Editor control to the external editor that it's supplying to the grid. I'm going to forward this thread over to Infragistics Developer Support so they can check it out and get it fixed. 

In the mean time, you can work around this by explicitly setting the property on the button in the grid like so:


        private void ultraTextEditor1_BeforeEditorButtonDropDown(object sender, Infragistics.Win.UltraWinEditors.BeforeEditorButtonDropDownEventArgs e)
        {
            DropDownEditorButton button = (DropDownEditorButton)e.Button;
            button.DropDownResizeHandleStyle = Infragistics.Win.DropDownResizeHandleStyle.DiagonalResize;           
               
            UltraGridCell c = e.Context as UltraGridCell;
            if (c != null)
                ultraTextEditor2.Text = c.Text;
        }

 

Mike Saltzman

Manager - Windows Forms Development

Infragistics, Inc.

  • Post Points: 20
Replied On: Wed, Jan 12 2011 9:36 AM

Hello Tom,

I have logged this as a development issue.

Dave F

Developer Support Engineer

Infragistics, Inc.

http://www.infragistics.com/support

  • Post Points: 5
Points 520
exploitit
Replied On: Wed, Jan 12 2011 10:14 AM

Mike & Dave,

Sorry I have been caught in other stuff for the last few days. Thanks very much for figuring this out and providing a workaround, I never thought it'd actually be a bug (first one I've encountered so far!).

Little things like this make all the difference!

 

Thanks again, Tom

  • Post Points: 5
Points 20
jeev
Replied On: Thu, Feb 17 2011 9:42 AM

Hi Mike,

I applied your code and it work fine but I need to block user from editing the text in cell itself , mean I don't want to allow user to edit the text in cell it self. Do you know , how I can achieve it.

 Please excuse me if it is a silly question as I am using infragistic component for only 2 weeks. Posting on the forum are helping me a lot and bringing me upto the speed. Heads off to every one.

Regards

 

  • Post Points: 20
Replied On: Fri, Feb 18 2011 10:38 AM

Hi Jeev,

This is a pretty long thread, and I'm not sure exactly what you are asking or if it's related to the topic of this thread.

To make an UltraTextEditor control read-only, you can use the ReadOnly property.

If this is a grid column, then you would use the column's CellActivation property.

Mike Saltzman

Manager - Windows Forms Development

Infragistics, Inc.

  • Post Points: 5
Points 420
siddika
Replied On: Wed, Jan 25 2012 1:33 PM

Hi Mike,

In ultraTextEditor's ButtonsRight collection, i can see only EditorButton, not DropDownEditorButton. pls help.

  • Post Points: 20
Points 420
siddika
Replied On: Wed, Jan 25 2012 2:45 PM

when i am setting cell value on ultrsTextEditor1_AfterEditButtonCloseUp event , it set null value even though ultraTextEditor2 contains Text.

my code :

 

 

private

 

 

void ultraTextEditorOptField_AfterEditorButtonCloseUp(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e){

UltraGridCell c = e.Context as UltraGridCell;

if (c != null)

c.Value = ultraTextEditor2.Text;

}

 

 

 

 

  • Post Points: 20
Page 1 of 2 (21 items) 1 2 Next > | RSS