Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 ASP.NET
 Format gridview columns for multiline textbox

Author  Topic 

sheena
Starting Member

45 Posts

Posted - 2007-04-08 : 00:06:24
Hi Everyone,

I m creating my application in ASP.NET 2005 with C# and SQL SERVER 2005.

In asp.net standard control i have used the multiline textbox in my application and on the click event it displays in gridview.
The textbox is used for the address.

I want to display the data in gridview in the same way as i have written in multiline textbox.

But,it is not possible.Can anyone help me to format the gridview columns...so that the multiline textbox fits into it properly..

Waiting for some replies..thanxs

sheena
Starting Member

45 Posts

Posted - 2007-04-12 : 01:37:03
No one is there who can help me...
If anyone knows the answer then pls help me out...
thanxs
Go to Top of Page

dfiala
Posting Yak Master

116 Posts

Posted - 2007-04-12 : 06:51:16
You need to provide a more descriptive question than

>>I want to display the data in gridview in the same way as i have written in multiline textbox.
>>But,it is not possible.Can anyone help me to format the gridview columns...so that the multiline textbox fits into it properly..

How do you want to display your data?
What exactly is not fitting properly? The text box in the grid? The text in the text box?

No one else can see your problem and don't want to wast time guessing what you mean. You need to describe the issue as fully as possible.

Dean Fiala
Very Practical Software, Inc
Now with Blogging...
http://www.vpsw.com/blogbaby
Microsoft MVP
Go to Top of Page

sheena
Starting Member

45 Posts

Posted - 2007-04-12 : 11:39:10
<body>
<form id="form1" runat="server">
<div>
Id   
<asp:TextBox ID="tbid" runat="server" Enabled="False"></asp:TextBox>
<br />
Address   
<asp:TextBox ID="tbaddress1" runat="server" Rows="4" TextMode="MultiLine" ></asp:TextBox>
<br />

<asp:Button ID="cmdview" runat="server" Text="View" OnClick="cmdview_Click" />
<br />

<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:addresstable%>"
ProviderName="System.Data.SqlClient"
Selectcommandtype="StoredProcedure" SelectCommand="addressSelect "
</asp:SqlDataSource>

<asp:GridView ID="GridView1" runat="server" DataSourceID="SqlDataSource1" autogeneratecolumns="false"
AutoGenerateDeleteButton="false" AutoGenerateEditButton="false"
DataKeyNames=id>

<Columns>
<asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
<asp:boundfield datafield="id"
readonly="True"
headertext="ID"/>
<asp:boundfield datafield="address"
headertext="Address"/>
</Columns>

</asp:GridView>

</div>
</form>
</body>


protected void Page_Load(object sender, EventArgs e)
{
GridView1.Visible = true;
}
Go to Top of Page

sheena
Starting Member

45 Posts

Posted - 2007-04-12 : 11:44:39
The above code is just a sample which may help now to answer my question i suppose...if anything missing then let me know again...

Ok,now i want to display the 2fields in gridview i.e. ID and Address..
I want to adjust the size of the columns of the id and address..i.e i want the id column small and address column bigger in size i.e. i want to resize the columns.So,only i told in my
subject that i want to "Format gridview columns".

I think the columns of the gridview are not resizable.They are predefined for each column...

Hope this time anyone can understand what i want and explain me how to resize the girdview columns...

thanxs
Go to Top of Page

sheena
Starting Member

45 Posts

Posted - 2007-04-13 : 10:31:01
hello,what's missing now...
i put the code sample...then too noo reply..

In short,i want to display the autoincrement id from the database in the textbox which is readonly for the user at the runtime when the user want to add the new record then and then only...
Go to Top of Page
   

- Advertisement -