gridview1 and i have 5 column in table1.. i want coulumn1 ofn gridview1 to display 2 field (2 column of table1) ??

hello friends

gridview1 and i have 5 column in table1.. i want coulunm1 ofn gridview1 to display 2 field (2 column of table1). how can i do this ?

cheers


Mark as me if my question or my answer can be helpful for you :)
0
oguzkaygun
6/21/2008 9:43:47 AM
asp.net.presentation-controls 72751 articles. 3 followers. Follow

7 Replies
527 Views

Similar Articles

[PageSpeed] 15

Hi

What I understood from your query is that you want to bind the table data with grid as follows:

gridview1.column1 with table1.column1

gridview2.column2 with table2.column2

 and so on.

if is that the case you can bind the columns with the grid view columns in that manner in design as follows: 

<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource1">
            <Columns>
                <asp:BoundField DataField="Column1" HeaderText="Column1" />
                <asp:BoundField DataField="Column2" HeaderText="Column2" />
                <asp:BoundField DataField="Column3" HeaderText="Column3" />
                <asp:BoundField DataField="Column4" HeaderText="Column4" />
                <asp:BoundField DataField="Column5" HeaderText="Column5" />
            </Columns>
        </asp:GridView>
Hope this helps you.

Shekar.Y(GGKTech)
http://ggktech.com
Dont forget to click “Mark as Answer” on the post that helped you.
0
chandrashekar
6/21/2008 10:24:05 AM

hi

i want per boundfield to display 2 column :) no 1 column :)

like datafield="column1+ column2"

how can i do this ?

cheers


Mark as me if my question or my answer can be helpful for you :)
0
oguzkaygun
6/21/2008 11:13:43 AM

hi

i have below code lines.. but datalist1 coulumn doesnt display with widht 120 px.. it display with long of dataitem.. what i entered before.. for example 200px or more.. how can i fix it ?

<ItemTemplate>

<itemstyle width="120" />

<br />

<a href='<%# DataBinder.Eval(Container.DataItem,"resimpath",Request.ApplicationPath+"/detayliurun.aspx?PID={0}") %>'>

<asp:image id="Image2" runat="server"

bordercolor="#B2A8C6"

imageurl='<%# DataBinder.Eval(Container.DataItem,"resimpath","{0}") %>'

Height="85px" Width="100px"/>

</a>

<br>

<asp:hyperlink id="HyperLink1" runat="server" Width="120px"

text='<%# DataBinder.Eval(Container.DataItem,"ilanbasligi") %> '

navigateurl='<%# DataBinder.Eval(Container.DataItem,"resimpath",Request.ApplicationPath+"/detayliurun.aspx?PID={0}") %>'></asp:hyperlink>

</ItemTemplate>


Mark as me if my question or my answer can be helpful for you :)
0
oguzkaygun
6/22/2008 11:12:30 AM

Hi oguzkaygun ,

I do not think to add <itemstyle width="120" /> can change item width.

You can try :

<asp:DataList ID="DataList1" runat="server" Width="450px">

 

 



Samu Zhang
Microsoft Online Community Support

Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question.
0
Samu
6/24/2008 2:49:11 AM

Hi

thank you for your reply :)

i tried it but it didnt run again..

cheers


Mark as me if my question or my answer can be helpful for you :)
0
oguzkaygun
6/24/2008 9:51:44 AM

please be more specific while posting a question.

0
SanjaySutar
6/24/2008 10:01:07 AM

hi

i am sorry :)

i mean that when i put "widht=450 px" near datalist1, i see almost 700 px because my column information is long..

i want my column to display 2-3 line when it so long :) but it display 1 line and it is so long and my datalist1 seems long

cheers


Mark as me if my question or my answer can be helpful for you :)
0
oguzkaygun
6/24/2008 10:16:42 AM
Reply:

Similar Artilces:

UPDATE column in table1 from 2 columns...
Hey ya'll... I need to create a query that I can run that will allow me to essentially take the first initial and last name and combine them from two columns in one table and update one column with that new data in another table. Example of need: UPDATE tblLogin.UserName with (first character(tblEmployee.FName)+(tblEmployee.LName)) WHERE tblLogin.EmployeeID = tblEmployee.EmployeeID. That was TOTALLY pseudo code and I know I'll need a join statement in there somewhere. Both tables reside on the same database, such as this: dbEMPLOYEE (Database)--> tblLogin (Table)----> UserName (Col...

how can i display table1 and table2 to gridview1 ?? i want to display two or more tables to one gridview1 ??
hello friends how can i display table1 and table2 to gridview1 ?? i want to display two or more tables to one gridview1 ?? is it possible ? cheers :Mark as me if my question or my answer can be helpful for you :)  You need to read up on JOINs between tables in SQL Server.  Basically:SELECT C.Name, C.Address, S.State FROM Customers AS CINNER JOIN States AS S ONC.StateID = S.StateIDWHERE C.Name = 'Smith'This builds a result set which can populate a GridView...HTH This really depends on what you want to achieve. You can use JOIN to retrieve items that is on table1 based...

Why 2 <td> columns in Design tab are displayed as 1 column only in a browser presentation?
I have coded a Table with 1 <tr> and 2 <td> to read fildes from 2 folders.The Design tab did show coding 1 and coding 2 as 2 cells/columns side by side in one row of a table.  However, the browser presentation showed the files ofthe 2nd folders directly under the files of the 1st folder.  Why the browser presentation showed only one coulmn while the Design tabshowed 2 columns?  What might be the reasons for this mistake? TIA,Jeffrey      Please post your HTML.Please remember to "mark as answered" posts that ...

2 group-column Display Style #2
Suppose the query result as follows: Group Number ----- ------ A 1 B 1 C 1 D 1 D 2 E 1 F 1 G 1 G 2 Is it possible to present the data in Datawindow like the following? I'm using PB 6.5, thanks. A B 1 1 C D 1 1 2 E F 1 1 G 1 2 Most anything is possible in a programming environment! Unfortunately, this type of display can only be done by manually populating the datawindow via code. There is no style or format you can choose at design time to do t...

FooterTemplate wants to start on Column 2 not Column 1
Hi all, I don't have a lot of experience using the FooterTemplate in the Gridview (used it once to insert/add new records).  This problem seems awkward and I'm confident I'm overlooking something simple.  Basically, no matter what I do here, the text in the FooterTemplate starts in column 2.  Below is a sample of my code.  The commented out lines are what I originally had before I tried defining templates hoping that would resolve the issue but it didn't.  I also added Text for the FooterTemplate columns for those columns that I'm not displaying....

Smoke [5.12.2] v5.12.2-5-g60a58e9 FAIL(F) MSWin32 WinXP/.Net SP3 (x86/2 cpu) #2
Automated smoke report for 5.12.2 patch 60a58e98bf9da0f7e06e47974d829b42b2c= c834e v5.12.2-5-g60a58e9 maldoror.bath.planit.group: Intel(R) Core(TM)2 CPU 6700 @ 2.66GHz(~2660 MHz= ) (x86/2 cpu) on MSWin32 - WinXP/.Net SP3 using cl version 12.00.8804 smoketime 6 hours 29 minutes (average 38 minutes 56 seconds) Summary: FAIL(F) O =3D OK F =3D Failure(s), extended report at the bottom X =3D Failure(s) under TEST but not under harness ? =3D still running or test results not (yet) available Build failures during: - =3D unknown or N/A c =3D Configure, m =...

WHERE COLUMN=1 AND COLUMN=2
I have a table that I need to select ALL values that are submitted, so I can't use COLUMN IN (1,2) as this would return all rows with either 1 or 2. Same goes for using OR. So how do I transform the impossible query "WHERE COLUMN=1 AND COLUMN=2" into one that actually returns a result? In this example what I want to return would be all id's that have 1 AND 2 in the column in question, just to be be clear. Cheers! /Eskil   A column can only have ONE value. It can't be both 1 and 2. -- "Mark As Answer" if my reply helped you -- ...

Want to start new header column 2 columns into first row
I want to add a new header to the first row of my gridview but i want to start 2 columns into the first row. I tried row.Cells.AddAt(2,Cell); but this gives me an error.so how can it be done?    Here is my code so far........     protected void GridView1_RowDataBound1(object sender, GridViewRowEventArgs e)    {        SortedList creatCels = new SortedList();        creatCels.Add("1", "Test,2,1");         GetMyMultiHeader1...

How to divide 1 GridView Row with 1 column in 2 Rows with 5 columns?
Hi; I have a GridView with 10 rows and 1 column. How can I do to this GridView show the same data, but with 2 rows and 5 columns? In classic ASP, I made it this way: While (NOT rsFotos.EOF) if i mod 5 = 0 then Response.Write "</tr><tr>" end if ... Someone can help? :)  You have to use a custom template and lay the table out the way you want, either dropping controls in the template or creating a custom ITemplate that takes care of it for you. http://professionalaspnet.com/archive/2006/06/15/Useing-ITemplate-in-the-Data-Controls.aspxChris L...

Can a Repeater Control display records in 2 Columns?
I am trying to make use of some empty space on my page that displays in a Repeater control a bunch of records that only have a small amount of data to display in 3 Columns. I am trying to figure out if I can split 2 records into 2 columns side by side then repeat the next 2 records below the first 2. So essentially I want the repeater to repeat twice horizontally, then step vertically down one line and repeat 2 more records horizontally. ie. Record 1 Record 2 Record 3 Record 4 Record 5 Record 6 and so on... Anything would be great and yes no maybe so, or a li...

Smoke [5.12.2] v5.12.2 FAIL(F) MSWin32 WinXP/.Net SP3 (x86/2 cpu) #5
Automated smoke report for 5.12.2 patch 7a3b65c9d99f69553fffe01f73d49fe9abf= 95120 v5.12.2 maldoror.bath.planit.group: Intel(R) Core(TM)2 CPU 6700 @ 2.66GHz(~2660 MHz= ) (x86/2 cpu) on MSWin32 - WinXP/.Net SP3 using cl version 13.10.3077 smoketime 6 hours 32 minutes (average 39 minutes 12 seconds) Summary: FAIL(F) O =3D OK F =3D Failure(s), extended report at the bottom X =3D Failure(s) under TEST but not under harness ? =3D still running or test results not (yet) available Build failures during: - =3D unknown or N/A c =3D Configure, m =3D make, M ...

Smoke [5.12.2] v5.12.2-5-g60a58e9 FAIL(F) MSWin32 WinXP/.Net SP3 (x86/2 cpu)
Automated smoke report for 5.12.2 patch 60a58e98bf9da0f7e06e47974d829b42b2c= c834e v5.12.2-5-g60a58e9 maldoror.bath.planit.group: Intel(R) Core(TM)2 CPU 6700 @ 2.66GHz(~2660 MHz= ) (x86/2 cpu) on MSWin32 - WinXP/.Net SP3 using cl version 13.10.3077 smoketime 6 hours 40 minutes (average 40 minutes 1 seconds) Summary: FAIL(F) O =3D OK F =3D Failure(s), extended report at the bottom X =3D Failure(s) under TEST but not under harness ? =3D still running or test results not (yet) available Build failures during: - =3D unknown or N/A c =3D Configure, m =3...

Smoke [5.12.2] v5.12.2-3-g4ffae9c FAIL(F) MSWin32 WinXP/.Net SP3 (x86/2 cpu) #5
Automated smoke report for 5.12.2 patch 4ffae9cec64e9dd4150c249b8d63bdceb4e= 65fb2 v5.12.2-3-g4ffae9c maldoror.bath.planit.group: Intel(R) Core(TM)2 CPU 6700 @ 2.66GHz(~2660 MHz= ) (x86/2 cpu) on MSWin32 - WinXP/.Net SP3 using cl version 12.00.8804 smoketime 6 hours 26 minutes (average 38 minutes 40 seconds) Summary: FAIL(F) O =3D OK F =3D Failure(s), extended report at the bottom X =3D Failure(s) under TEST but not under harness ? =3D still running or test results not (yet) available Build failures during: - =3D unknown or N/A c =3D Configure, m =...

Smoke [5.12.2] v5.12.2-4-g6b6803c FAIL(F) MSWin32 WinXP/.Net SP3 (x86/2 cpu) #5
Automated smoke report for 5.12.2 patch 6b6803ca5cc042a20bd63333defdcf9b4b5= a045c v5.12.2-4-g6b6803c maldoror.bath.planit.group: Intel(R) Core(TM)2 CPU 6700 @ 2.66GHz(~2660 MHz= ) (x86/2 cpu) on MSWin32 - WinXP/.Net SP3 using cl version 12.00.8804 smoketime 6 hours 31 minutes (average 39 minutes 11 seconds) Summary: FAIL(F) O =3D OK F =3D Failure(s), extended report at the bottom X =3D Failure(s) under TEST but not under harness ? =3D still running or test results not (yet) available Build failures during: - =3D unknown or N/A c =3D Configure, m =...

Web resources about - gridview1 and i have 5 column in table1.. i want coulumn1 ofn gridview1 to display 2 field (2 column of table1) ?? - asp.net.presentation-controls

City of North Miami
SEARCH Contact Us - Employment - Español - Kreyol 305.893.6511 - 776 NE 125 Street - North Miami, FL 33161 EMERGENCY SERVICES HOME DEPARTMENTS ...

Check Uncheck all CheckBoxes in an ASP.NET GridView using jQuery
... void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { Employee emp = new Employee(); listEmp = emp.GetEmployees(); this.GridView1.DataSource ...

TEA Staff Search
Administrators school resources Teachers teacher resources Funding school finance & grants Testing / Accountability student assessment & ...

TEA Staff Search
Administrators school resources Teachers teacher resources Funding school finance & grants Testing / Accountability student assessment & ...

Resources last updated: 11/30/2015 1:56:56 PM