Thursday, March 29, 2012
Newbie : Gridview question
I have a gridview on my page and templatecolumns defined in it. I also have
a couple of databound columns. The datatable being bound to the gridview
contains a column (defined as a datacolumn so as to get the value) and in
the ItemDataBound I can access this value but only when the databound
column's visibility is set to true. If I hide the visibility at design-time
I can't get access to the value at run-time. I don't want to show this
column.
How do I go about geting the value so as to do someting with it but not show
the databound column?
Regards
John.Hi John,
You can put these values in DataKeyNames, and retrieve by
.DataKeys[row_index].Values[col_index]
HTH
Elton Wang
"John" wrote:
> Hi all,
> I have a gridview on my page and templatecolumns defined in it. I also hav
e
> a couple of databound columns. The datatable being bound to the gridview
> contains a column (defined as a datacolumn so as to get the value) and in
> the ItemDataBound I can access this value but only when the databound
> column's visibility is set to true. If I hide the visibility at design-tim
e
> I can't get access to the value at run-time. I don't want to show this
> column.
> How do I go about geting the value so as to do someting with it but not sh
ow
> the databound column?
> Regards
> John.
>
>
Newbie : Gridview question
I have a gridview on my page and templatecolumns defined in it. I also have
a couple of databound columns. The datatable being bound to the gridview
contains a column (defined as a datacolumn so as to get the value) and in
the ItemDataBound I can access this value but only when the databound
column's visibility is set to true. If I hide the visibility at design-time
I can't get access to the value at run-time. I don't want to show this
column.
How do I go about geting the value so as to do someting with it but not show
the databound column?
Regards
John.Hi John,
You can put these values in DataKeyNames, and retrieve by
..DataKeys[row_index].Values[col_index]
HTH
Elton Wang
"John" wrote:
> Hi all,
> I have a gridview on my page and templatecolumns defined in it. I also have
> a couple of databound columns. The datatable being bound to the gridview
> contains a column (defined as a datacolumn so as to get the value) and in
> the ItemDataBound I can access this value but only when the databound
> column's visibility is set to true. If I hide the visibility at design-time
> I can't get access to the value at run-time. I don't want to show this
> column.
> How do I go about geting the value so as to do someting with it but not show
> the databound column?
> Regards
> John.
>
Saturday, March 24, 2012
newbie DropDownList inside a GridView cell question
to a DataTable Row element that contains a foriegn key in the data record.
For the DropDownList items, I need data from the primary key in another
table. It almost looks like the DropDownList needs binding to two separate
tables. Is that possible? If so, can someone tell me which DropDownList
property references the foreign key table and which one references the
primary key table?
Thanks,
KeithLook at the source code of this demo:
http://www.webswapp.com/codesamples...s/gridview.aspx
--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"keithb" wrote:
> Using ASP.NET 2.0, I need to a DropDownList in a GridView cell that is bound
> to a DataTable Row element that contains a foriegn key in the data record.
> For the DropDownList items, I need data from the primary key in another
> table. It almost looks like the DropDownList needs binding to two separate
> tables. Is that possible? If so, can someone tell me which DropDownList
> property references the foreign key table and which one references the
> primary key table?
> Thanks,
> Keith
>
newbie DropDownList inside a GridView cell question
to a DataTable Row element that contains a foriegn key in the data record.
For the DropDownList items, I need data from the primary key in another
table. It almost looks like the DropDownList needs binding to two separate
tables. Is that possible? If so, can someone tell me which DropDownList
property references the foreign key table and which one references the
primary key table?
Thanks,
KeithLook at the source code of this demo:
http://www.webswapp.com/codesamples...s/gridview.aspx
--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"keithb" wrote:
> Using ASP.NET 2.0, I need to a DropDownList in a GridView cell that is bou
nd
> to a DataTable Row element that contains a foriegn key in the data record.
> For the DropDownList items, I need data from the primary key in another
> table. It almost looks like the DropDownList needs binding to two separate
> tables. Is that possible? If so, can someone tell me which DropDownList
> property references the foreign key table and which one references the
> primary key table?
> Thanks,
> Keith
>
>
Thursday, March 22, 2012
Newbie how to connect to data field together
I have a gridview which has VS 2.0 C#
First name , last name and phone number in different colums I would like to combined the first name with the last name putting the last name first.
Example what I have John | Doe | 555-5555 |
What I want Doe,John | 555-5555 |
any one can tell me how to do this?
you can use a format like this:
<
asp:GridViewID="GridViewProperty"runat="server"AutoGenerateColumns="False"DataKeyNames="Id"DataSourceID="ObjectDataSource1"><Columns><asp:TemplateFieldHeaderText="Full Name"><ItemTemplate><asp:LabelID="Label1"runat="server"Text='<%# Eval("Address") + " " + Eval("City") %>'></asp:Label></ItemTemplate></asp:TemplateField>Change it to a template column and add the fields under that. Or if you got the dataset you can use that to create an string
string sAllfields = dataset.Table[0].Row[0][1].ToString() + dataset.Table[0].Row[0][2].ToString() + dataset.Table[0].Row[0][2].ToString();
Friday, March 16, 2012
newbie needing help Dropdownlist
I have a dropdownlist on a webform that is objectdatabouund to a gridview all the connections work fine. the issue at hand is the dropdownlist populates with the first item lets say that is a name if i start to type the first letter of a diferent namthe list jumps to the letter it type the problem is i can not enter the total name or part of the name it only allow the first letter to be entered how can it get it to do a lookup as i type in the dropdown
I hope I am making sense.
a regular dropdownlist does not directly support that.
have you considered 3rd party controls?
for example:http://easylistbox.com/demoCombo.aspx
You can also have a look at this for incremental search on dropdownlist.
http://www.dotnet247.com/247reference/msgs/29/146771.aspx
Thanks
Thanks for the mention, Mike; also,http://easylistbox.com/demoSpeedSearch.aspx .
E_screw, it looks like that one uses onkeypress and some IE-specific stuff (which may or may not matter to the OP). If you want a slightly more cross-browser approach, trythis article instead; feel free to offer constructive criticism as well.
Cheers,
Peter,
I am looking for a ajax autocomplete I will use the throughtout my application I look at the easylistbox.com solution but was a bit confused about your pricing I will have one url: site using this how much is your cost? How indepth is it to intergrate?
Integration is very simple. You can make it as simple as putting the control on the page and setting the connection string and query, or get a bit more complex with regular .NET databinding.
As far as pricing goes, a single-website license would cover your situation. In fact, a website can have multiple domain names under this scheme as well, as long as they all point to the same directory.
Peter,
I downloaded the trial version of your software to test it out. I have a couple questions. I orginally had a drop down connected thru the object by a dataset to a datagrid I have the drop down containing the last name and it looks up the correct name ok. I created a new webform page to duplicate the same but used your easylistbox I can not see how to connect the dropdown to the object form ny dataset your field also extends across my entire screen . Does the field not have a control on the right corner that allows postback and connection?
I'm not entirely sure what you mean. Youshould be able to use ELB to display data, and get the selection onpostback (via the SelectedValue property). There are demos on thewebsite for just about all of this; if you want to bind to a DataSetobject, you would do it the same way you would with aDropDownList: assign the Dataset as the DataSource property,assign DataValueField and DataTextField, and call DataBind.
As for the width problem, it sounds like you may be using anincompatible DOCTYPE statement. See the instructions about thisin the Installation section of the Help file(Start->Programs->EasyListBox should get you there). Futurereleases will be more compatible with XHTML Transitional, but for nowit would be a good thing to switch the validation schema.
We should probably take further correspondence off this thread since itsort of strays into the realm of commercial product support; let meknow what I can to do help!
Cheers,
PeterBrunone:
Thanks for the mention, Mike; also,http://easylistbox.com/demoSpeedSearch.aspx .
E_screw, it looks like that one uses onkeypress and some IE-specific stuff (which may or may not matter to the OP). If you want a slightly more cross-browser approach, trythis article instead; feel free to offer constructive criticism as well.
Cheers,
Peter, I do really appreciate the work you have done on ELB. I have seen it and its great! Just working out to the OP a non-commercial (may or may not matter to the OP) way.
For a cross browser approach, i prefer the AutoCompleteExtender of ASP.NET AJAX and the article you mentioned was good :)
Thanks