Jump to content
Xtreme .Net Talk

Search the Community

Showing results for tags 'datagridview'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • New Member at Xtreme .Net Talk?
    • Meet and Greet
    • Announcements
  • .NET
    • General
    • Windows Forms
    • ASP.NET
    • Directory / File IO / Registry
    • Database / XML / Reporting
    • Network
    • Graphics and Multimedia
    • Interoperation / Office Integration
    • Deployment
    • Regular Expressions
    • Syntax Specific
  • Knowledge Base
    • Tutors Corner
    • Code Library
    • Quick Tips
  • Xtreme .Net Talk Members Area
    • Water Cooler
    • Suggestions, Bugs, and Comments

Blogs

There are no results to display.

Categories

  • Code Samples
  • Tutorials & Guides
  • Articles
  • Code Downloads

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


About Me


Location


Occupation


Visual Studio .NET Version


.NET Preferred Language


Skype


Facebook


Twitter ( X )

Found 5 results

  1. Is there a way to extend the bounds of a control, so that it has some extra space between the physical boundary and the graphical edge? Look at the image in attachment that demonstrates what I want to achieve. In this case it is a datagridview with some extra space on the right. Sure, I could put it inside a usercontrol, but I want this control to Inherit directly from DataGridView.
  2. Hi, I am making a usercontrol containing a datagridview and some additional controls and I need to expose the Columns property of the datagridview in my usercontrol at design-time. I know that it isn´t as easy as "Public Property Grid as DataGridView ..." and I tried many of the workarounds that I found on the internet, but with no success. Obviously the best way is to write a custom ColumnCollectionEditor. Could someone please provide a complete solution for this problem in VB.Net? Thanks in advance.
  3. A am trying to make a simple database application just to learn SQLCE. I can not get the simplest things to work: adding and deleting records. Here´s how it looks now: Conn = New SqlCeConnection(CS) 'set the connection Conn.Open() 'and open it 'the database has 1 table called Invoices and 2 columns. First column called ID (identity with auto increment set to true) is the primary key. Second is a string (nvarchar) column called InvoiceNo. TA = New SqlCeDataAdapter("SELECT * FROM Invoices", Conn) 'set the data adapter CB = New SqlCeCommandBuilder(TA) Dim DSF as New Dataset 'a blank dataset TA.Fill(DSF, "Invoices") 'filling the dataset DSF.Tables("Invoices").PrimaryKey = New DataColumn() {DSF.Tables("Invoices").Columns("ID")} 'I need a primary key to easily search for records in dataset by ID 'there is a DataGridView called DG on the form DG.DataSource = DSF DGFaktury.DataMember = "Invoices" Works nicely. Loads all data into the datagrid. Now I want to insert a record: Dim R As DataRow = DSF.Tables("Invoices").NewRow R.Item("InvoiceNo") = "027" DSF.Tables("Invoices").Rows.Add(R) TA.Update(DSF, "Invoices") 'so far so good I can get the new row into the database. But in my datagrid I see only the new InvoiceNo, but not the new ID. Of course the dataset doesn´t know what ID was assigned to the new row in the database, so I have to get it somehow. So here´s what I did. Dim cmd As New SqlCeCommand("SELECT ID FROM Invoices WHERE (ID = @@IDENTITY)", Conn) Dim id As Integer = CInt(cmd.ExecuteScalar()) R.Item("ID") = id 'now I see the ID of newly added record - wow Here comes the problem: there is a Delete button on my form. When I click it, and the newly added row in the datagrid is selected, it executes this: Dim ID As Integer = DG.SelectedRows(0).Cells("ID").Value 'retrieves the ID DSF.Tables("Invoices").Rows.Find(ID).Delete() 'finds a row in the dataset and deletes it TA.Update(DSF, "Invoices") I ended up with an exception: DBConcurrencyException, DeleteCommand affected 0 of 1 expected rows. After inserting the new row, the dataset changed when I changed the ID, so it thinks it has to update the record while deleting it at the same time and that´s what is causing the error. Is that right? There´s no problem while deleting older records. Am I going the right direction? Is there another way to get these simple operations (insert, delete, update) to work? I found tutorials dealing with wieving of data only, but not inserting, updating or deleting.
  4. I've created a base form with (among other commonly used controls) a DataGridView control. It's Design Modifiers Property is set to Public so that I can position the control to where it is needed on my various inherited forms. However, on all of the Inherited Forms, all of the properties of the DataGridView control are grayed out. Other "base form controls" (a custom control, a picture box, and a status bar) are all able to be modified on the inherited forms. How do I get them enabled?
  5. I have an app that is currently getting data from a remote server, via the internet, and putting that data into a DataGridView. The data (a full client list) is being pulled down when the app is started and displayed. This solution has worked but now the customer is getting too many clients to bring down at one shot. The number of clients is starting to cause a significant delay at startup and I'm looking for a new method of getting the data. The customer wants to keep the DataGridView functionality. I'd like to be able to put a textbox on the form so that on each keystroke I could call a stored proc that would return the first 20 clients that matched the current textbox entry. Then, as the customer would press PageDown or DownArrow, I would retrieve the next 20 that matched the textbox entry. Or if the customer pressed PageUp or UpArrow, I would retrieve the previous 20. Does this design sound workable or am I way off in wanting to accomplish this from a remote server? Can anyone point me toward a sample that would be a good starting point? I realize this will be a significant code change in this part of my application. Current code layout: SqlCommand sc = new SqlCommand(SP_SELECT_CLIENTS, conn); sc.CommandType = CommandType.StoredProcedure; SqlDataAdapter da = new SqlDataAdapter(sc); conn.Open(); da.Fill(dsClients, CLIENT_TABLE_NAME); conn.Close(); // bind table to BindingSource and DataGridView m_ClientBindingSource.DataSource = dsClients.Tables[CLIENT_TABLE_NAME]; dgvClient.DataSource = m_ClientBindingSource; Thanks in advance, flynn
×
×
  • Create New...