473,383 Members | 1,880 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Gridview with listbox when editing!

Hello Everyone. I need to use a gridview, that when I use the Update command
one of the colums, instead of showing a textbox where the user can write, I
need
a combobox (listobx), where there are 3 options.
EG OF GRIDVIEW:
USUER AGE
carlosg old
rominat young
gonzalor normal
florenciat young
roberto old

Thank you!
Apr 25 '06 #1
4 4833
Use a templatefield, you can put what you like in it

"Marcos Beccar Varela | GamaCom Argentina" wrote:
Hello Everyone. I need to use a gridview, that when I use the Update command
one of the colums, instead of showing a textbox where the user can write, I
need
a combobox (listobx), where there are 3 options.
EG OF GRIDVIEW:
USUER AGE
carlosg old
rominat young
gonzalor normal
florenciat young
roberto old

Thank you!

Apr 25 '06 #2
Thank you, I´ve made it this way.
<HeaderTemplate>Estado</HeaderTemplate>

<ItemTemplate>

<asp:Label Width="50px" ID="Label5" runat="server" text='<%#
Eval("est_ped_desc")%>'></asp:Label>

</ItemTemplate>

<EditItemTemplate>
<asp:ListBox Rows="1" runat="server" ID="id_estado"
DataSourceID="SqlDataSource5" DataValueField="id_estados"
DataTextField="est_ped_desc"></asp:ListBox>

</EditItemTemplate>

</asp:TemplateField>
Do you know how I can pass the parameter of the value to the sqldatasource?
Thank you

"clickon" <cl*****@discussions.microsoft.com> escribió en el mensaje
news:51**********************************@microsof t.com...
Use a templatefield, you can put what you like in it

"Marcos Beccar Varela | GamaCom Argentina" wrote:
Hello Everyone. I need to use a gridview, that when I use the Update
command
one of the colums, instead of showing a textbox where the user can write,
I
need
a combobox (listobx), where there are 3 options.
EG OF GRIDVIEW:
USUER AGE
carlosg old
rominat young
gonzalor normal
florenciat young
roberto old

Thank you!

Apr 25 '06 #3
As below:

<asp:ListBox Rows="1" runat="server" ID="id_estado"
DataSourceID="SqlDataSource5" DataValueField="id_estados"
DataTextField="est_ped_desc" SelectedValue='<%#Bind("ParameterName")%>'
</asp:ListBox>

"Manekurt" wrote:
Thank you, I´ve made it this way.
<HeaderTemplate>Estado</HeaderTemplate>

<ItemTemplate>

<asp:Label Width="50px" ID="Label5" runat="server" text='<%#
Eval("est_ped_desc")%>'></asp:Label>

</ItemTemplate>

<EditItemTemplate>
<asp:ListBox Rows="1" runat="server" ID="id_estado"
DataSourceID="SqlDataSource5" DataValueField="id_estados"
DataTextField="est_ped_desc"></asp:ListBox>

</EditItemTemplate>

</asp:TemplateField>
Do you know how I can pass the parameter of the value to the sqldatasource?
Thank you

"clickon" <cl*****@discussions.microsoft.com> escribió en el mensaje
news:51**********************************@microsof t.com...
Use a templatefield, you can put what you like in it

"Marcos Beccar Varela | GamaCom Argentina" wrote:
Hello Everyone. I need to use a gridview, that when I use the Update
command
one of the colums, instead of showing a textbox where the user can write,
I
need
a combobox (listobx), where there are 3 options.
EG OF GRIDVIEW:
USUER AGE
carlosg old
rominat young
gonzalor normal
florenciat young
roberto old

Thank you!


Apr 25 '06 #4
Thank you, I´m having trouble understandig parameters from gridview to
sqldatasource.
everything goes fine, but not update done. No error, but not update.
Thank again

<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
CellPadding="4"

DataSourceID="SqlDataSource3" ForeColor="#333333" GridLines="None"
Width="544px">
<FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />

<Columns>
<asp:BoundField AccessibleHeaderText="id_solicitinscr"
DataField="id_solicitinscr"

ReadOnly="True" ShowHeader="False" Visible="False" />
<asp:BoundField AccessibleHeaderText="Jugador" DataField="id_jugador"
HeaderText="Jugador"

ReadOnly="True">

<ItemStyle Font-Bold="True" />

</asp:BoundField>
<asp:BoundField AccessibleHeaderText="Fecha" DataField="soli_fecha"
DataFormatString="{0:d}" HeaderText="Fecha" ReadOnly="True" />
<asp:TemplateField>
<HeaderTemplate>Estado</HeaderTemplate>

<ItemTemplate>

<asp:Label Width="50px" ID="Label5" runat="server" text='<%#
Eval("est_ped_desc")%>'></asp:Label>

</ItemTemplate>

<EditItemTemplate>

<asp:ListBox Rows="1" runat="server" ID="id_estado"
DataSourceID="SqlDataSource5" DataValueField="id_estados"
DataTextField="est_ped_desc"></asp:ListBox>

</EditItemTemplate>

</asp:TemplateField>

<asp:CommandField CancelText="Cancelars" EditText="Editar"
InsertVisible="False" ShowEditButton="True" SelectText="Seleccionar"
UpdateText="Grabar">

<ItemStyle Width="50px" />

</asp:CommandField>

</Columns>

<RowStyle BackColor="#F7F6F3" ForeColor="#333333" />

<EmptyDataTemplate>

<asp:Label ID="Label2" runat="server" Font-Bold="True" Text="Sin
Solicitudes"></asp:Label>

</EmptyDataTemplate>

<EditRowStyle BackColor="#999999" CssClass="mk_cellitem" />

<SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333"
/>

<PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center"
/>

<HeaderStyle BackColor="#43597F" BorderStyle="None" BorderWidth="0px"
Font-Bold="True"

ForeColor="White" HorizontalAlign="Left" Wrap="True" />

<AlternatingRowStyle BackColor="White" ForeColor="Black" />

</asp:GridView>


<asp:SqlDataSource ID="SqlDataSource3" runat="server" ConnectionString="<%$
ConnectionStrings:ClubSiteDB %>"

ProviderName="<%$ ConnectionStrings:ClubSiteDB.ProviderName %>"
SelectCommand="SELECT mkg_juginscriptsoli.id_solicitinscr,
mkg_juginscriptsoli.id_jugador, mkg_juginscriptsoli.soli_fecha,
mkg_estados_solicit.est_ped_desc FROM mkg_juginscriptsoli INNER JOIN
mkg_estados_solicit ON mkg_juginscriptsoli.soli_estado =
mkg_estados_solicit.id_estados INNER JOIN aspnet_Users ON
mkg_juginscriptsoli.id_jugador = aspnet_Users.UserName WHERE
(mkg_juginscriptsoli.id_torneo = @id) ORDER BY
mkg_juginscriptsoli.soli_fecha"

UpdateCommand="UPDATE mkg_juginscriptsoli SET soli_estado = @id_estados
WHERE id_solicitinscr = @id_solicitinscr">

<SelectParameters>

<asp:Parameter DefaultValue="1" Name="id" />

</SelectParameters>

<UpdateParameters>

<asp:Parameter Name="id_estados" />

<asp:Parameter Name="id_solicitinscr" />

</UpdateParameters>

</asp:SqlDataSource>

<asp:SqlDataSource ID="SqlDataSource5" runat="server" ConnectionString="<%$
ConnectionStrings:ClubSiteDB %>"

ProviderName="<%$ ConnectionStrings:ClubSiteDB.ProviderName %>"
SelectCommand="SELECT id_estados, est_ped_desc FROM
mkg_estados_solicit">

</asp:SqlDataSource>

"clickon" <cl*****@discussions.microsoft.com> escribió en el mensaje
news:46**********************************@microsof t.com...
As below:

<asp:ListBox Rows="1" runat="server" ID="id_estado"
DataSourceID="SqlDataSource5" DataValueField="id_estados"
DataTextField="est_ped_desc" SelectedValue='<%#Bind("ParameterName")%>'
</asp:ListBox>

"Manekurt" wrote:
Thank you, I´ve made it this way.
<HeaderTemplate>Estado</HeaderTemplate>

<ItemTemplate>

<asp:Label Width="50px" ID="Label5" runat="server" text='<%#
Eval("est_ped_desc")%>'></asp:Label>

</ItemTemplate>

<EditItemTemplate>
<asp:ListBox Rows="1" runat="server" ID="id_estado"
DataSourceID="SqlDataSource5" DataValueField="id_estados"
DataTextField="est_ped_desc"></asp:ListBox>

</EditItemTemplate>

</asp:TemplateField>
Do you know how I can pass the parameter of the value to the
sqldatasource?
Thank you

"clickon" <cl*****@discussions.microsoft.com> escribió en el mensaje
news:51**********************************@microsof t.com...
> Use a templatefield, you can put what you like in it
>
> "Marcos Beccar Varela | GamaCom Argentina" wrote:
>
>> Hello Everyone. I need to use a gridview, that when I use the Update
>> command
>> one of the colums, instead of showing a textbox where the user can
>> write,
>> I
>> need
>> a combobox (listobx), where there are 3 options.
>> EG OF GRIDVIEW:
>> USUER AGE
>> carlosg old
>> rominat young
>> gonzalor normal
>> florenciat young
>> roberto old
>>
>> Thank you!
>>
>>
>>


Apr 26 '06 #5

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

Similar topics

7
by: Byron | last post by:
I'm looking for a way to deny a move from the current listbox item. For instance, if the user is editing the record associated with the current listbox item I want to deny a move within the...
4
by: Tomasz Jastrzebski | last post by:
Hello Everyone, I have a GridView control bound to a plain DataTable object. AutoGenerateEditButton is set to true, Edit button gets displayed, and RowEditing event fires as expected.
3
by: cpnet | last post by:
I have a GridView which I'm populating from an ObjectDataSource (give the GridView a DataTable). The GridView will have about 20 rows, and only one editable column. The editable column consists...
1
by: =?Utf-8?B?Q2hyaXM=?= | last post by:
Hi, I have a gridview which I added a <asp:CommandField EditText="E" CancelText="C" UpdateText="U" ButtonType="Link" ShowEditButton="True" /> my gridview looks like this <asp:GridView...
1
by: servernet1997 | last post by:
I have a gridview with 4 columns. Two of the columns are read-only and two are editable. The two editable columns are listboxes leveraging an ObjectDataSource. The first listbox is populated from a...
2
by: =?Utf-8?B?TWljaGFlbCBkZSBWZXJh?= | last post by:
To all, I'm trying to bind a dataset to a listbox control that is in a gridview's templated field. However, in the code behind the intellisense does not recognize the ID name of my listbox...
2
by: Tim Royal | last post by:
I'm using a GridView inside a Wizard Control with a textbox and two listboxes in the footer. I populate these listboxes from the database if the page isn't on postback (and the textbox is left...
0
by: seanmatthewwalsh | last post by:
This should be REALLY straightforward. I have a gridview that allows editing, deleting and inserting (from the footer row). There is a Drop Down ListBox in the one column, which needs to ALWAYS set...
11
by: SAL | last post by:
Hello, I have a Gridview control (.net 2.0) that I'm having trouble getting the Update button to fire any kind of event or preforming the update. The datatable is based on a join so I don't know...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.