.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Custom Editing Behavior for DataGridView TextBox Columns

Posted By: Faizal     Posted Date: January 28, 2010    Points: 2   Category :Windows Application
For various reasons I'm using a DataGridView instead of a ListView, and while configuring the DataGridView to look like a ListView wasn't much of a problem, there's one thing that got on my nerves, which is the behavior of textbox cells in edit mode: It is much too easy to leave the edit mode accidentally, simply by pressing the cursor keys at the wrong time. For example when the text caret is positioned behind the last character of the textbox cell content, and you press the right arrow key

View Complete Post

More Related Resource Links

How can I set the value of a Custom FormField textbox to an ASP Textbox's value?


Info: WSS 3.0 MOSS 2007 Windows Server 2003, SQL 2005.

I created a new ASPX page on one of my sites, and configured it the following way:

SQL Datasource to my own database and a series of drop down boxes that help the user configure a part number. Once that part number is created, they click the submit button to submit it to my separate database. I also have a custom SharePoint list that I would like to add that part number to so that it generates emails and does other workflow related tasks.

How can I copy the text that is within the part number asp:textbox and throw it into the SharePoint:FormField Textbox so that it can be submitted to SharePoint?

I have C# code within the page that handles the ASP side of things, but I can't seem to reference the ff1{$Pos} id of the FormField. If I had to guess, i'd need to create some code that injects the javascript that gets reference to the FormField by Field Type and Field Name. But...I'm not entirely sure how to do that.

Any help is appreciated, thank you!

Creating List Definitions with Custom List Columns for SharePoint Server 2007

Learn to use Visual Studio 2008 Extensions for Windows SharePoint Services to create a SharePoint list definition that implements custom list columns.

DataGridView>Edit Columns> Column Read Only property is unwilling to change

Hello, I am facing the following mystery: When changing the read only property of a column to false and reopening the "edit columns" window, it mysteriously turns back to true. Even when closing the designer and changing it in the designer code, the resulting execution does not allow edit, as well as when re-opening the designer you see true again.             this.numberDataGridViewTextBoxColumn1.DataPropertyName = "Number";             this.numberDataGridViewTextBoxColumn1.HeaderText = "Number";             this.numberDataGridViewTextBoxColumn1.Name = "numberDataGridViewTextBoxColumn1";             this.numberDataGridViewTextBoxColumn1.ReadOnly = true;//False is required We thought it might be related to data binding. rebinding the grid did not help as well. The is no other place in the code where it changes. Please advice, Thanks

Sign outgoing body from client with custom endpoing behavior defined in code

I'm trying to sign (and sign only) the body of every outgoing message that uses this custom endpoint behavior.  When I first created this it was for signing a custom SOAP header.  We are moving away from that and going to just sign the body.  We have some applications that have 10+ web service references.  We don't want to touch the reference.cs for anything.  Below is the code I had before for signing the custom soap header.  I'm trying to modify it to just sign the body.  My modified code is below, and the error I get. Private Class CustomHeaderBehavior Implements ServiceModel.Description.IEndpointBehavior Public Sub New() End Sub Private Sub AddBindingParameters( _ ByVal endpoint As ServiceModel.Description.ServiceEndpoint, _ ByVal bindingParameters As ServiceModel.Channels.BindingParameterCollection) _ Implements ServiceModel.Description.IEndpointBehavior.AddBindingParameters Dim body As New Xml.XmlQualifiedName("Body", "http://schemas.xmlsoap.org/soap/envelope/") Dim BodyMsgPartSpec As New ServiceModel.Security.MessagePartSpecification() BodyMsgPartSpec.IsBodyIncluded = True Dim requirements As ServiceModel.Security.ChannelProtectionRequirements = bindingParameters.Remove(Of ServiceModel.Security.ChannelProtectionRequirements)() requirements

DataGridView freeze columns issue

When i try to freeze a column that is off screen (to the right) when the DataGridView's (DGV) first displayed column is the first column in the DGV, the DGV refreshes and displays the DGV from the first column in the DGV. Also, the horizontal scrollbar on the bottom of the page disappears.  This means that i cannot see the unfrozen columns and i cant get over to view the column that I froze. This seems to behave differently from freezing a column in Excel, which freezes the columns you are currently viewing at that moment (not sending you back to the first row) and then the scroll bar applies to the frozen columns like normal. Is there a workaround for this? I tried setting the first displayed index for the column and I get an exception. I'm using .NET 3.5 on an XP machine.

Struggling to remove ellipses when columns in a DataGridView are automatically truncated

Hi all, I've got approx. 20 columns in a DataGridView so screen real estate is a little limited! All the columns have a fixed width, and in my old DataGrid when the content was too big for cell it would simply disappear off the edge so a cell containing 'flibberty' would be in the table cell |flibber| In contrast, with datagridview this becomes |flibb...| - I'd really really like to get rid of these ellipses and get the old DataGrid behaviour for this case - but it doesn't seem straightforward at all, can anyone help? Thanks, Henri

Unable to create columns in document library after applying custom master page to site

Hi, I have applied a custom master page to a site.There is a document library in it. I am unable to add columns in it or change the default view.Nothing happens when I click on OK butoon after making my changes. However the columns are created/default view is changed when I apply the default master page. Guess I am missing some TagPrefix or sharepoint control on master page.I had solved this problem earlier in this way but don't remeber it now. Can anyone help?

Custom Validator on DDL&Textbox values

I need to write a 2 custom validators that works as follows: I have a formview (Formview1) with an EditItemTemplate. The validators need to validate values in "DropDownList1" and a textbox called "EndUserGUIDTextBox" If the value in DDL1 is ("Assigned" or "Assigned to End User") and the value of EndUserGUIDTextBox is ("unassigned" or "pending" or NULL) then I need a validator to fire and return {"GUID must be assigned when status is" & DLL1 value}. If the value in DDL1 is ("In Stock" or "In Repair") and EndUserGUIDTextBox is NOT ("unassigned" or "pending" or NULL), then I need a validator to fire and return {"GUID must not be assigned when status is" & DLL1 Value}. The validators needs to run and show in the formview when the UpdateButton in my Formview is clicked. I'm doing this in VB. Real noobie here! All help appreciated. Thanks,

custom columns in document libraries

Hi I created two custom columns "Fromdate, Todate" in document librarie, and assigned a document to other user. when other user logIn, in the tasks list, select the item and click on "Edit item" edit form is opened, but i could not found Columns "Fromdate, Todate", where did I went wrong! I created custom workflow in VS2005(no forms are used)

The sum value is not reflected immeditly in the textbox, using my custom code.

Hi,    I created a custom expense form, i used reperting table and i has column named "Total" in the repeating table. At the footer of the repeating table i add a texbox, that hold Grand total of the "Total" column from the repeating table. To get the grand total i used to get the texbox value and sum it and assign it to another control. It work fine in Infopath form. But when i open it in Web browser, the updated value is not shown immeditaly, when i click on insertitem link a new row get added.Why it happen in web browser.?

Custom field and editing

I have created a custom field and have it added to a list.  I created the usercontrol and it work beautifully in the editform.aspx page.  The problem come in that I also want this field to be also used with folders.  From the object model I have added the metadata to that field for the folder, but when I edit the properties of the folder, the control will not show in the editform.aspx.  Can I get it to show for folders? Can I create some custom aspx page that will show it?  I know that you can create folders based on other content types, but that will not work for me. I am working with existing lists. 

Lookup columns in a SharePoint Custom list

Hi, I would like to know the maximum lookup columns we can create in a SharePoint Custom list. Thanks and regards, Usha   

Columns collection of a DataGridView within a UserControl won't serialize to designer

First of all, I've found this issue on connect which describes my problems exactly, however, I've been able to find a workaround but I don't find it acceptable so I appeal to you for an idea of how to resolve this as cleanly as possible. What I've done is, I've applied a custom designer to my UserControl like so [Designer(typeof(CustomControlDesigner))]public partial class DataGridViewTag : UserControl, ISupportInitialize In the CustomControlDesigner I don't do much at this point, I set selection rules and add a few DesignerVerbs. The important thing is, I also EnableDesignMode for the DataGridView in my UserControl. Then, I expose DataGridView's DataSource and Columns collection like this: [Editor(typeof(CollectionEditor), typeof(UITypeEditor))][Category("Grid")][DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]public DataGridViewColumnCollection Columns{    get { return dgvList.Columns; } set { dgvList.Columns.Clear(); foreach (DataGridViewColumn col in value) dgvList.Columns.Add(col); }} [AttributeProvider(typeof(IListSource))] [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)] [Category("Grid")] public object DataSource{ get { return dgvList.DataSource;&nbs

Change custom activity behavior



To run the workflows from XAML I use WorkflowApplication.Run. I would like to change behavior of the custom activity depends on how the activity was running. I mean - in some situations my custom activity should report to DB, but in other situation shouldn't. I can add InArgument (or property) to this activity, but I don't know how to pass to my custom activity value for this InArgument (property).

Is there any other way to do, what I described?

how to sum columns(sql) and show it in textbox?


 i have 50 columns and i want to show the total of each column(total of rows in this column) into 1 textbox that mean they show in 20 textbox, please help me in aspx.vb. mrhua@ovi.com

handle up & down keys while editing a cell in datagridview to affect listbox


I have a datagridview. i have overridden some datagridview methods to capture enter key and updown key in a separate class



i also have a listbox. while i am editing a cell the listbox is being visible and searching in the listbox for what is in the cell's textbox. (i am also able to catch the up down key but from a different class which overrides some methods.)

Now what i need is when i press up and down key the listbox's selected items will change accordingly.

Plz help me to solve it.

Mapping custom values and columns to destination table **Newb question**



I am copying data from one source to destination SQL CE table using the data flow task. I have two extra requirements which I am not sure how to achieve.

1.)  One source column needs to be mapped to two destination columns. In the column mapping dropdown the column name disappears after mapping it to one destination column.

2) some custom values for columns need to be added, which are not present in source. For e.g. a default value for some destination columns which is not present.

Any pointers would be extremely appreciated. Thanks,

Ganesh Ranganathan
[Please mark the post as answer if it answers your question]
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend