473,839 Members | 1,667 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Making ONLY 2 columns editable in a datagrid

Hi,
I have 2 questions:

1. I have an editable data grid with 21 columns. I need to edit only 2
cloumns in this data grid. But when the grid is displayed in Edit mode, all
the columns show long text boxes whichmakes the user to SCROLL a lot.
I need only these 2 cloumns to be displayed in Edit mode. Is that possible &
how?

2. Also, even when the data grid is not displayed in the edit mode, it
causes a lot of scrolling. Is there some way to avoid this?

--
pmud
Nov 19 '05 #1
8 2413
For the first question, have you tried to hide the column? or only cast two
columns in which you require Editing?

For the second question I will suggest using a <div> or <layer> or an
<iframe>,
it will make another scrollable window in ur main web page

"pmud" wrote:
Hi,
I have 2 questions:

1. I have an editable data grid with 21 columns. I need to edit only 2
cloumns in this data grid. But when the grid is displayed in Edit mode, all
the columns show long text boxes whichmakes the user to SCROLL a lot.
I need only these 2 cloumns to be displayed in Edit mode. Is that possible &
how?

2. Also, even when the data grid is not displayed in the edit mode, it
causes a lot of scrolling. Is there some way to avoid this?

--
pmud

Nov 19 '05 #2
Hi Chinmay,

How to cast only 2 cloumns which require editing coz I want to see all the
columns & then with the click of a button, I am exporting this grid to EXcel.
So i need to view all the columns when I click EDIT but only 2 columns should
be displayed in EDIT mode to avoid scrolling.

Do u think a data grid is appropriate or should I use some other control
which avoids a lot of scrolling & also allows editing & updating the database
fileds?

"Chinmay" wrote:
For the first question, have you tried to hide the column? or only cast two
columns in which you require Editing?

For the second question I will suggest using a <div> or <layer> or an
<iframe>,
it will make another scrollable window in ur main web page

"pmud" wrote:
Hi,
I have 2 questions:

1. I have an editable data grid with 21 columns. I need to edit only 2
cloumns in this data grid. But when the grid is displayed in Edit mode, all
the columns show long text boxes whichmakes the user to SCROLL a lot.
I need only these 2 cloumns to be displayed in Edit mode. Is that possible &
how?

2. Also, even when the data grid is not displayed in the edit mode, it
causes a lot of scrolling. Is there some way to avoid this?

--
pmud

Nov 19 '05 #3
Hi,

I found out how to make only certain columns in data grid editabel. Its
simply a matter of going to the Property builder of the data grid --> columns
& there in Selected columns ...checking the Read only to true for the text
boxes which you dont want to be edited.

Its as simple as that. But if you could please tell me how to use <frame >
tag on a data grid coz <frame > has a SRC property which is set to the web
page one wants to scroll. But to use it with a data grid? The web page in
which I have the data grid has another table & a button. When the user clicks
the button , based on user's input recorrds are displayed in data grid.

I just want the <frame > tag on the data grid & not on the table. Or if
anyone has any other ideas to AVOID a lot of scrolling for the user coz my
DATA GRID has 21 COLUMNS.

"pmud" wrote:
Hi Chinmay,

How to cast only 2 cloumns which require editing coz I want to see all the
columns & then with the click of a button, I am exporting this grid to EXcel.
So i need to view all the columns when I click EDIT but only 2 columns should
be displayed in EDIT mode to avoid scrolling.

Do u think a data grid is appropriate or should I use some other control
which avoids a lot of scrolling & also allows editing & updating the database
fileds?

"Chinmay" wrote:
For the first question, have you tried to hide the column? or only cast two
columns in which you require Editing?

For the second question I will suggest using a <div> or <layer> or an
<iframe>,
it will make another scrollable window in ur main web page

"pmud" wrote:
Hi,
I have 2 questions:

1. I have an editable data grid with 21 columns. I need to edit only 2
cloumns in this data grid. But when the grid is displayed in Edit mode, all
the columns show long text boxes whichmakes the user to SCROLL a lot.
I need only these 2 cloumns to be displayed in Edit mode. Is that possible &
how?

2. Also, even when the data grid is not displayed in the edit mode, it
causes a lot of scrolling. Is there some way to avoid this?

--
pmud

Nov 19 '05 #4
Put this code in the ASPX
<div id="DGMainHolde r" style="Z-INDEX: 1; OVERFLOW: scroll; WIDTH: 755px;
POSITION: static; HEIGHT: 300px">Your DataGrid Code</div>

"pmud" wrote:
Hi,

I found out how to make only certain columns in data grid editabel. Its
simply a matter of going to the Property builder of the data grid --> columns
& there in Selected columns ...checking the Read only to true for the text
boxes which you dont want to be edited.

Its as simple as that. But if you could please tell me how to use <frame >
tag on a data grid coz <frame > has a SRC property which is set to the web
page one wants to scroll. But to use it with a data grid? The web page in
which I have the data grid has another table & a button. When the user clicks
the button , based on user's input recorrds are displayed in data grid.

I just want the <frame > tag on the data grid & not on the table. Or if
anyone has any other ideas to AVOID a lot of scrolling for the user coz my
DATA GRID has 21 COLUMNS.

"pmud" wrote:
Hi Chinmay,

How to cast only 2 cloumns which require editing coz I want to see all the
columns & then with the click of a button, I am exporting this grid to EXcel.
So i need to view all the columns when I click EDIT but only 2 columns should
be displayed in EDIT mode to avoid scrolling.

Do u think a data grid is appropriate or should I use some other control
which avoids a lot of scrolling & also allows editing & updating the database
fileds?

"Chinmay" wrote:
For the first question, have you tried to hide the column? or only cast two
columns in which you require Editing?

For the second question I will suggest using a <div> or <layer> or an
<iframe>,
it will make another scrollable window in ur main web page

"pmud" wrote:

> Hi,
> I have 2 questions:
>
> 1. I have an editable data grid with 21 columns. I need to edit only 2
> cloumns in this data grid. But when the grid is displayed in Edit mode, all
> the columns show long text boxes whichmakes the user to SCROLL a lot.
> I need only these 2 cloumns to be displayed in Edit mode. Is that possible &
> how?
>
> 2. Also, even when the data grid is not displayed in the edit mode, it
> causes a lot of scrolling. Is there some way to avoid this?
>
> --
> pmud

Nov 19 '05 #5
Hi Chinmay,

I used the <div> tag. But my web page also has a few text boxes & a few
lables before the data grid. So when I used the <div> tags & scrolled
vertically, the data grid scrolls up into the text boxes & labels. I want to
make only the grid vertically scrollable so that it doesnt move inside the
labels & text boxes on scrolling.

Any help is appreciated.
Thanks

"Chinmay" wrote:
Put this code in the ASPX
<div id="DGMainHolde r" style="Z-INDEX: 1; OVERFLOW: scroll; WIDTH: 755px;
POSITION: static; HEIGHT: 300px">Your DataGrid Code</div>

"pmud" wrote:
Hi,

I found out how to make only certain columns in data grid editabel. Its
simply a matter of going to the Property builder of the data grid --> columns
& there in Selected columns ...checking the Read only to true for the text
boxes which you dont want to be edited.

Its as simple as that. But if you could please tell me how to use <frame >
tag on a data grid coz <frame > has a SRC property which is set to the web
page one wants to scroll. But to use it with a data grid? The web page in
which I have the data grid has another table & a button. When the user clicks
the button , based on user's input recorrds are displayed in data grid.

I just want the <frame > tag on the data grid & not on the table. Or if
anyone has any other ideas to AVOID a lot of scrolling for the user coz my
DATA GRID has 21 COLUMNS.

"pmud" wrote:
Hi Chinmay,

How to cast only 2 cloumns which require editing coz I want to see all the
columns & then with the click of a button, I am exporting this grid to EXcel.
So i need to view all the columns when I click EDIT but only 2 columns should
be displayed in EDIT mode to avoid scrolling.

Do u think a data grid is appropriate or should I use some other control
which avoids a lot of scrolling & also allows editing & updating the database
fileds?

"Chinmay" wrote:

> For the first question, have you tried to hide the column? or only cast two
> columns in which you require Editing?
>
> For the second question I will suggest using a <div> or <layer> or an
> <iframe>,
> it will make another scrollable window in ur main web page
>
> "pmud" wrote:
>
> > Hi,
> > I have 2 questions:
> >
> > 1. I have an editable data grid with 21 columns. I need to edit only 2
> > cloumns in this data grid. But when the grid is displayed in Edit mode, all
> > the columns show long text boxes whichmakes the user to SCROLL a lot.
> > I need only these 2 cloumns to be displayed in Edit mode. Is that possible &
> > how?
> >
> > 2. Also, even when the data grid is not displayed in the edit mode, it
> > causes a lot of scrolling. Is there some way to avoid this?
> >
> > --
> > pmud

Nov 19 '05 #6
Well! In this case I suggest you to seperate ur UI in Table Cells.
See the code
<table>
<tr>
<td>Ur Other Controls</td>
</tr>
<tr>
<td>ur Div and Datagrid</td>
</tr>
</table>
Nov 19 '05 #7
Hi Chinmay,

I tried putting my HTML table(which contains labels & text boxes) & the
data grid into another table & put the 1st table as a row in the outher table
& the data grid as one row & buttons & everything as other rows.... But it
doesnt work... All the controls lay in a haphazard way when I did this...

I am using the following code. Please tell me what can i do with it so that
only the data grid is scrollable & not the table above it... I would be
grateful for ur help.

HTML Code::

<body MS_POSITIONING= "GridLayout " bgColor="gainsb oro">
<form id="Form1" method="post" runat="server">

<asp:image id="Image1" style="Z-INDEX: 102; LEFT: 389px; POSITION:
absolute; TOP: 8px" runat="server" ImageUrl="file:///C:\Documents and
Settings\user\M y Documents\image s\a.jpg"></asp:image><asp: label id="Label1"
style="Z-INDEX: 103; LEFT: 400px; POSITION: absolute; TOP: 119px"
runat="server"
Font-Bold="True" Font-Underline="True " Width="96px">VI EW
LOGS</asp:label><asp: linkbutton id="LinkButton1 " style="Z-INDEX: 104; LEFT:
94px; POSITION: absolute; TOP: 99px"
runat="server" Width="9px" Height="3px">Ho me</asp:linkbutton> </td>

<TABLE id="Table1" style="Z-INDEX: 107; LEFT: 303px; WIDTH: 305px;
POSITION: absolute; TOP: 148px; HEIGHT: 91px"
cellSpacing="1" cellPadding="1" width="305" border="1">
<TR>
<TD style="WIDTH: 126px; HEIGHT: 25px">
<asp:label id="lblCompany " runat="server" Font-Bold="True"
Width="117px" Height="5px">Co mpany Name</asp:label></TD>
<TD style="HEIGHT: 25px">
<asp:textbox id="txtCompany " runat="server" Width="139px"
Height="24px"></asp:textbox></TD>
</TR>
<TR>
<TD style="WIDTH: 126px; HEIGHT: 27px">
<asp:label id="lblMonth" runat="server" Font-Bold="True"
Width="91px" Height="5px">Mo nth</asp:label></TD>
<TD style="HEIGHT: 27px">
<asp:dropdownli st id="ddlMonth" runat="server" Width="115px"
Height="8px">
<asp:ListItem Value="None">No ne</asp:ListItem>
<asp:ListItem Value="January" >January</asp:ListItem>
<asp:ListItem Value="Feburary ">Feburary</asp:ListItem>
<asp:ListItem Value="March">M arch</asp:ListItem>
<asp:ListItem Value="April">A pril</asp:ListItem>
<asp:ListItem Value="May">May </asp:ListItem>
<asp:ListItem Value="June">Ju ne</asp:ListItem>
<asp:ListItem Value="July">Ju ly</asp:ListItem>
<asp:ListItem Value="August"> August</asp:ListItem>
<asp:ListItem Value="Septembe r">September </asp:ListItem>
<asp:ListItem Value="October" >October</asp:ListItem>
<asp:ListItem Value="November ">November</asp:ListItem>
<asp:ListItem Value="December ">December</asp:ListItem>
</asp:dropdownlis t></TD>
</TR>
<TR>
<TD style="WIDTH: 126px">
<asp:label id="Label2" runat="server" Font-Bold="True" Width="5px"
Height="5px">Ye ar</asp:label></TD>
<TD>
<asp:textbox id="txtYear" runat="server" Width="126px"
Height="25px"></asp:textbox></TD>
</TR>
</TABLE>

<asp:button id="btnSubmit" style="Z-INDEX: 101; LEFT: 397px; POSITION:
absolute; TOP: 261px"
runat="server" Text="Submit"></asp:button></td>
<div id="DGMainHolde r"
style="OVERFLOW :scroll;WIDTH:9 60px;HEIGHT:900 px"><asp:datagr id id=DataGrid1
style="Z-INDEX: 105; LEFT: 0px; POSITION: absolute; TOP: 478px"
runat="server" ForeColor="Blac k" CellPadding="4" BackColor="#CCC CCC"
CellSpacing="2" BorderWidth="3p x" BorderStyle="So lid" BorderColor="#9 99999"
AutoGenerateCol umns="False" DataKeyField="A siOrder#" DataMember="For mFields"
DataSource="<%# dsCompany1 %>">
<FooterStyle BackColor="#CCC CCC"></FooterStyle>
<SelectedItemSt yle Font-Bold="True" ForeColor="Whit e"
BackColor="#000 099"></SelectedItemSty le>
<ItemStyle BackColor="Whit e"></ItemStyle>
<HeaderStyle Font-Bold="True" ForeColor="Whit e"
BackColor="Blac k"></HeaderStyle>
<Columns>
<asp:EditComman dColumn ButtonType="Lin kButton" UpdateText="Upd ate"
CancelText="Can cel" EditText="Edit" ></asp:EditCommand Column>
<asp:BoundColum n DataField="Date " SortExpression= "Date"
ReadOnly="True" HeaderText="Act ivation"
DataFormatStrin g="{0:d}">
<ItemStyle Width="70px"></ItemStyle>
</asp:BoundColumn >
<asp:BoundColum n DataField="Regi on" SortExpression= "Region"
ReadOnly="True" HeaderText="Reg ion">
<ItemStyle Width="55px"></ItemStyle>
</asp:BoundColumn >
<asp:BoundColum n DataField="SIM" SortExpression= "SIM"
ReadOnly="True" HeaderText="SIM ">
<ItemStyle Width="50px"></ItemStyle>
</asp:BoundColumn >

<asp:BoundColum n DataField="SubA gentName"
SortExpression= "SubAgentNa me" ReadOnly="True" HeaderText="Sub Agent">
<ItemStyle Width="60px"></ItemStyle>
</asp:BoundColumn >
<asp:BoundColum n DataField="Cust omerName"
SortExpression= "CustomerNa me" ReadOnly="True" HeaderText="Cus tomer">
<ItemStyle Width="75px"></ItemStyle>
</asp:BoundColumn >
<asp:BoundColum n DataField="Acco unt#" SortExpression= "Account#"
ReadOnly="True" HeaderText="Acc ount">
<ItemStyle Width="50px"></ItemStyle>
</asp:BoundColumn >
<asp:BoundColum n DataField="User Name" SortExpression= "UserName"
ReadOnly="True" HeaderText="Use r">
<ItemStyle Width="60px"></ItemStyle>
</asp:BoundColumn >

</Columns>
<PagerStyle HorizontalAlign ="Left" ForeColor="Blac k"
BackColor="#CCC CCC" Mode="NumericPa ges"></PagerStyle>
</asp:datagrid></div>
<asp:button id="btnExpExcel " style="Z-INDEX: 106; LEFT: 460px; POSITION:
absolute; TOP: 984px"
runat="server" Text="Export to Excel" Height="32px"></asp:button>
</form>
</body>
"Chinmay" wrote:
Well! In this case I suggest you to seperate ur UI in Table Cells.
See the code
<table>
<tr>
<td>Ur Other Controls</td>
</tr>
<tr>
<td>ur Div and Datagrid</td>
</tr>
</table>

Nov 19 '05 #8
You'll have to remove Style tags which are specifying the position of the
controls, and don't look at the UI that DEV Env. shows, run the page and than
see for ur self!
Nov 19 '05 #9

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

Similar topics

0
1182
by: Andla Rand | last post by:
Hi, Could you help me to understand how datagrid works. I'm trying to make a datagrid editable. Now most of the tutorials I read says that i should turn the Enable ViewState off. Why is that? If i turn this off then i need to support building the datagrid because the datagrid is not persistant. Right?
0
1037
by: Brian Conway | last post by:
Is there was way to insert an addition editable column into a datagrid that is built from a select statement coming from the database? I have a datagrid that gets populated with seven fields, and one is Last Reported Mileage, I need the grid to bring up all the vehicles that they person logged in has, and then I need a field that has Current Mileage which needs to be editable so that they can type the new mileage in and then click on a...
1
1384
by: mai via DotNetMonster.com | last post by:
hi, i'm sort of a newbie in .net and i'm currently doing my major project. i would like to know if it is possible to have a datagrid that would not be having a database as its datasource? and is it possible to have an editable column in that datagrid wherein it would ask for user input? if so, can anyone be so kind to give me an example or just tell me how to do it? thanks! mai
1
1073
by: reiks | last post by:
I have a datagrid with two columns-name,id and both are editable. My requirement is that I want my second column(id) as a non updatable column.Though I can change the values of column by editing it,upon saying update,the second shouldn't be updated. Do we have to set any property or do it programatically?
4
1800
by: Stephan Bour | last post by:
Hi, I have a datagrid databound to a SQL query. I'd like to allow editing of some columns but not all. Is there a way to turn off the conversion of the datagrid cells to textboxes for some columns when the Edit button is pressed? Thank you, Stephan.
2
1435
by: Suma | last post by:
I have a problem with editable datagrid and was hoping if anyone could help me. Please help me if possible. I have an editable datagrid, whose column count I don’t know until runtime. I am sure of 3 columns Id,Name and Description. But there also might be more. So I add these 3 columns and an editcommandbutton and deletecommnadbutton at design time. Then during runtime I insert my other columns that I need, in between
9
3197
by: tshad | last post by:
I have a datagrid that I want to add a new column to. This column will only be visible under certain conditions. So I want to set the column visible=false. Then when the right condition happens to change it to visible=true. You can't do that with a bound column (no ID), but you can create a templatecolumn with a label. To make these visible, I am going through each datagriditem and making them visible after I have bound the data to...
3
1585
by: Jim Bancroft | last post by:
Hi everyone, I'm binding an ArrayList to a DataGrid for the first time (I'm used to binding DataSets and DataTables) and I was wondering if I could somehow "name" the ArrayList, so that I can refer to it as a DataField in an asp:BoundColumn? In essence, I'm doing this: ArrayList Arr1 = new ArrayList();
1
1117
by: miferdin | last post by:
Hi friends, 1. I have a datagrid with 5 columns, in this when i click edit in a row, all the columns changes into textbox but what i need is to make only a single column into a text box...how to do it... 2. How to edit the datagrid with single edit button above the datagrid and checkboxes in all the datarows. ie, by selecting the checkbox in a particular row and clicking the edit button should make that row editable...
0
10909
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10588
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...
1
10650
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10295
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
9426
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
7830
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
5867
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4492
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
4065
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.