473,698 Members | 2,149 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 4845
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_d esc")%>'></asp:Label>

</ItemTemplate>

<EditItemTempla te>
<asp:ListBox Rows="1" runat="server" ID="id_estado"
DataSourceID="S qlDataSource5" DataValueField= "id_estados "
DataTextField=" est_ped_desc"></asp:ListBox>

</EditItemTemplat e>

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

"clickon" <cl*****@discus sions.microsoft .com> escribió en el mensaje
news:51******** *************** ***********@mic rosoft.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="S qlDataSource5" DataValueField= "id_estados "
DataTextField=" est_ped_desc" SelectedValue=' <%#Bind("Parame terName")%>'
</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_d esc")%>'></asp:Label>

</ItemTemplate>

<EditItemTempla te>
<asp:ListBox Rows="1" runat="server" ID="id_estado"
DataSourceID="S qlDataSource5" DataValueField= "id_estados "
DataTextField=" est_ped_desc"></asp:ListBox>

</EditItemTemplat e>

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

"clickon" <cl*****@discus sions.microsoft .com> escribió en el mensaje
news:51******** *************** ***********@mic rosoft.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" AutoGenerateCol umns="False"
CellPadding="4"

DataSourceID="S qlDataSource3" ForeColor="#333 333" GridLines="None "
Width="544px">
<FooterStyle BackColor="#5D7 B9D" Font-Bold="True" ForeColor="Whit e" />

<Columns>
<asp:BoundFie ld AccessibleHeade rText="id_solic itinscr"
DataField="id_s olicitinscr"

ReadOnly="True" ShowHeader="Fal se" Visible="False" />
<asp:BoundFie ld AccessibleHeade rText="Jugador" DataField="id_j ugador"
HeaderText="Jug ador"

ReadOnly="True" >

<ItemStyle Font-Bold="True" />

</asp:BoundField>
<asp:BoundFie ld AccessibleHeade rText="Fecha" DataField="soli _fecha"
DataFormatStrin g="{0:d}" HeaderText="Fec ha" ReadOnly="True" />
<asp:TemplateFi eld>
<HeaderTemplate >Estado</HeaderTemplate>

<ItemTemplate >

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

</ItemTemplate>

<EditItemTempla te>

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

</EditItemTemplat e>

</asp:TemplateFie ld>

<asp:CommandFie ld CancelText="Can celars" EditText="Edita r"
InsertVisible=" False" ShowEditButton= "True" SelectText="Sel eccionar"
UpdateText="Gra bar">

<ItemStyle Width="50px" />

</asp:CommandFiel d>

</Columns>

<RowStyle BackColor="#F7F 6F3" ForeColor="#333 333" />

<EmptyDataTempl ate>

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

</EmptyDataTempla te>

<EditRowStyle BackColor="#999 999" CssClass="mk_ce llitem" />

<SelectedRowSty le BackColor="#E2D ED6" Font-Bold="True" ForeColor="#333 333"
/>

<PagerStyle BackColor="#284 775" ForeColor="Whit e" HorizontalAlign ="Center"
/>

<HeaderStyle BackColor="#435 97F" BorderStyle="No ne" BorderWidth="0p x"
Font-Bold="True"

ForeColor="Whit e" HorizontalAlign ="Left" Wrap="True" />

<AlternatingRow Style BackColor="Whit e" ForeColor="Blac k" />

</asp:GridView>


<asp:SqlDataSou rce ID="SqlDataSour ce3" runat="server" ConnectionStrin g="<%$
ConnectionStrin gs:ClubSiteDB %>"

ProviderName="< %$ ConnectionStrin gs:ClubSiteDB.P roviderName %>"
SelectCommand=" SELECT mkg_juginscript soli.id_solicit inscr,
mkg_juginscript soli.id_jugador , mkg_juginscript soli.soli_fecha ,
mkg_estados_sol icit.est_ped_de sc FROM mkg_juginscript soli INNER JOIN
mkg_estados_sol icit ON mkg_juginscript soli.soli_estad o =
mkg_estados_sol icit.id_estados INNER JOIN aspnet_Users ON
mkg_juginscript soli.id_jugador = aspnet_Users.Us erName WHERE
(mkg_juginscrip tsoli.id_torneo = @id) ORDER BY
mkg_juginscript soli.soli_fecha "

UpdateCommand=" UPDATE mkg_juginscript soli SET soli_estado = @id_estados
WHERE id_solicitinscr = @id_solicitinsc r">

<SelectParamete rs>

<asp:Paramete r DefaultValue="1 " Name="id" />

</SelectParameter s>

<UpdateParamete rs>

<asp:Paramete r Name="id_estado s" />

<asp:Paramete r Name="id_solici tinscr" />

</UpdateParameter s>

</asp:SqlDataSour ce>

<asp:SqlDataSou rce ID="SqlDataSour ce5" runat="server" ConnectionStrin g="<%$
ConnectionStrin gs:ClubSiteDB %>"

ProviderName="< %$ ConnectionStrin gs:ClubSiteDB.P roviderName %>"
SelectCommand=" SELECT id_estados, est_ped_desc F ROM
mkg_estados_sol icit">

</asp:SqlDataSour ce>

"clickon" <cl*****@discus sions.microsoft .com> escribió en el mensaje
news:46******** *************** ***********@mic rosoft.com...
As below:

<asp:ListBox Rows="1" runat="server" ID="id_estado"
DataSourceID="S qlDataSource5" DataValueField= "id_estados "
DataTextField=" est_ped_desc" SelectedValue=' <%#Bind("Parame terName")%>'
</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_d esc")%>'></asp:Label>

</ItemTemplate>

<EditItemTempla te>
<asp:ListBox Rows="1" runat="server" ID="id_estado"
DataSourceID="S qlDataSource5" DataValueField= "id_estados "
DataTextField=" est_ped_desc"></asp:ListBox>

</EditItemTemplat e>

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

"clickon" <cl*****@discus sions.microsoft .com> escribió en el mensaje
news:51******** *************** ***********@mic rosoft.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
2040
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 listbox until they have saved the changes. Is there any way to deny a move from the current item so the SelectedIndexChanged event never fires no matter move the movement was attempted? Whether the user uses the cursor keys or mouse to try and leave...
4
26698
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
13401
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 of a RadioButtonList ("Yes", "No", "Not Answered") in a TemplateColumn. I want the user to be able to select a radio button for each row in the GridView (without having to first put each row into edit mode). Once the user has selected the Radio...
1
4695
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 ID="GridView1" runat="server" OnRowEditing="RowEdit" OnRowCancelingEdit="RowCancel" OnRowUpdating="RowUpdating"...
1
1300
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 table of static information, the second listbox is more problematic. If the contents of the first listbox contains one specific value, I want to populate the second listbox with the results of QueryA when the row is edited. If the contents of...
2
4318
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 control....thus not giving me an opportunity to bind the listbox's datasource to a dataview. Can you make any recommendations? I'm trying to put a list box within a gridview so that an end user may select a record from the listbox and relate the...
2
3501
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 blank initially). All of these controls have viewstate enabled. When the user fills out the textfield and clicks ADD, I do a check for validation of the data. If the user does not select a valid listbox entry, I abort the rest of the add, and make...
0
1542
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 to a default value (but not always the same value, so I can't set it declaritively. It will ultimately depend on a session variable as to which default to use). However, the point is that the DDL in the footer (insert) row must ALWAYS be set,...
11
6062
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 if that's what's causing the behavior or not. It seems like the Update button should at least do something. When the Edit button is clicked, the grid goes into Edit mode and the Cancel button takes the grid out of Edit mode. So, I don't get what...
0
9016
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
7709
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
6515
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
5858
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
4360
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4613
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3037
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
2321
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
1997
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.