473,795 Members | 2,452 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DataGrid & DataView & DataGridTableSt yle

Rxd
I have a Datagrid that should have a couple of hidden columns. I used a
DataGridTableSt yle to hide the columns and it was working fine except I needed
to prevent the DataGrid from allowing new rows to be added. I was told to use a
DataView and set AddNew to false (thanks for the info btw) but now I can't use
the DataGridTableSt yle to hide the columns I don't want. Is there any way to
have both hidden columns and disable AddNew in a DataGrid?

Thanks
Nov 15 '05 #1
3 3958
Rdx,

You could use the click event of the grid. Then, if the currentRowIndex =
datasource.Rows .count call the endInit method of the grid. this should
allow you to use a datatable as a source to allow for table mappings and
stop the user from adding new.

hope this helps

Marco
"Rxd" <rx*@aol.com> wrote in message
news:20******** *************** ****@mb-m24.aol.com...
I have a Datagrid that should have a couple of hidden columns. I used a
DataGridTableSt yle to hide the columns and it was working fine except I needed to prevent the DataGrid from allowing new rows to be added. I was told to use a DataView and set AddNew to false (thanks for the info btw) but now I can't use the DataGridTableSt yle to hide the columns I don't want. Is there any way to have both hidden columns and disable AddNew in a DataGrid?

Thanks

Nov 15 '05 #2
Rxd
The click event doesn't seem to fire unless you click on a header. It doesn't
fire when you click on any of the grids cells...
Nov 15 '05 #3
Rxd,
Correct, you can check for addNew when not clicking on the elipsis(*) but on
a cell of the new Row, by doing the same verification using the
CurrentCellChan ged event.

datagrid.curren tCell.Rownumber
Marco
"Rxd" <rx*@aol.com> wrote in message
news:20******** *************** ****@mb-m24.aol.com...
The click event doesn't seem to fire unless you click on a header. It doesn't fire when you click on any of the grids cells...

Nov 15 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
6503
by: Mike Irwin | last post by:
I set up sorting by various columns for a DataGrid. For one of the columns, I would like to implement my own sort algorithm, though. For example, the column contains data like: <a href="http://www.example.com">DEF</a> <a href="http://www.test.somedomain">ABC</a> If I sort by the default algorithm, I get 'DEF' before 'ABC' because the strings are compared up until they differ after 'www.'. What I would like to do is somehow sort on...
1
1915
by: Sagaert Johan | last post by:
If i delete e record through the dataView ,the record is deleted in the underlying dataset, but when calling the dataadapter.udate method the database is not updated.(altough the record is deleted from the dataset ) (the haschanges record returns false ) Why ?
0
5360
by: Rudolph Araujo | last post by:
Hi, I needed to build a data grid in which the first column has hyperlinks rather than simple text. I found the following code on this newsgroup and it works fine except for one problem. When I click the column headers all the columns sort except the hyperlink one. I checked the underlying dataview and that does get sorted so it seems like it is more of a display issue. I am guessing it has something to do with the hashtable used by the...
1
1594
by: Karine Proot | last post by:
Hello Today I had to build a DataGrid very dynamically <asp:datagrid id="dgTAB" Runat="server" AutoGenerateColumns="False" OnEditCommand="TAB_Edit" OnCancelCommand="TAB_Cancel" OnUpdateCommand="TAB_Update" OnDeleteCommand="TAB_Delete"><Columns><asp:ButtonColumn HeaderText="Delete" Text="Delete" CommandName="Delete" /><asp:EditCommandColumn HeaderText="Edit" EditText="Edit" CancelText="Cancel" UpdateText="Update" /></Columns></asp:datagrid...
0
1468
by: Steve Kallal | last post by:
I have a DataGrid with an EditCommandColumn column set to a type of PushButton. I want to set set CssClass on these buttons and cannot without using code-behind code on the ItemDataBound event. The project lead does not want me to do this with code as he thinks it is too complex. But I cannot find a property in Design View or HTML View that works. Otherwise the edit buttons do not match the appearance of other buttons on the screen. Here is...
2
1533
by: Stan Sainte-Rose | last post by:
Hello, I need to know how to format Integer and Real with the datagrid. In fact, I want to use the right alignment. When I use this option the header text comes with the right alignment too. :( Another question with datagrid, is there a way to have "blank lines". I mean I would like to have (n) lines displayed even if they are empty (like an excel page). Just for the design.
0
1842
by: Nathan Franklin | last post by:
Hello Guys, I have been trying to work this our for so long, but I just can't seem to find the answer. I am loading a datatable from a an access database using an oledbdataadapter. I then assign the datatable.dataview to my datagrid.datasource member so it will display my results.. I need to give the user an option to change the order of this data, I have a
1
1552
by: beachboy | last post by:
Hello all, I am using the DataSet & DataView to display the file name in specify directory e.g: 112005.html , 022006.html, 052005.html i can create a datatable by fileinfo and insert all file name which is divied into month and year columns then i can put the sorted dataview into datalist to display..
2
2176
by: ree321 | last post by:
I tried moving an ASP.net project form 1.1 to 2.0. But I am having problems with getting the OnItemDataBound function to run for a datagrid, in 2.0. It only gets called up if AutoGenerateColumns is set to false. Is there anyway around this? Then I tried changing the datagrid to GridView and still I am having trouble getting the function to run in code behind using: Sub databoundGeneral(ByVal s As Object, ByVal e As
0
9519
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10214
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10001
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9042
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7538
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6780
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5563
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4113
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3723
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.