|
Hi,
Can u tell us exactly how u r setting the width of columns in the datagrid?
Thanks and Regards,
Chetan Ranpariya
|
|
|
|
|
The text has come to the width which I set now but the column width has not changed.
|
|
|
|
|
Hi,
Not getting the problem.
You want your columns to be with fixed width or u want them to be resize as per the length of content?
Thanks and Regards,
Chetan Ranpariya
|
|
|
|
|
I have a description column in my data grid. In the datagrid I don't want to show full description. only I want to show full description in details view.
|
|
|
|
|
Hi,
Then you should explicitly trim you description value coming from the database. This you can do in the ItemDataBound event of the datagrid.
private void dg_ItemDataBound(object sender, DatagridItemEventArgs e)
{
if(e.Item.ItemType == ListItemType.Item || e.Item.ItemType ==
ListItemType.AlternateItem)
{
if(e.Item.Cells[2].Text.Legth > 50)
{
e.Item.Cells[2].Text=e.Item.Cells[2].Text.Substring(0, 49) + "...";
}
}
}
Here column 2 in the datagrid is bound to the description field of the datasource.
I hope this will help you.
Thanks and Regards,
Chetan Ranpariya
|
|
|
|
|
Thanks, I am very new to this field can u help me if I am giving this in codebehind and should I do anything in source code(Template feild).
|
|
|
|
|
Hi,
Put this is in codebehind and replace "private" with "public" and u have to do one thing in the .aspx file.
set "OnItemDataBound" property of datagrid to "dg_ItemDataBound".
I hope this will help you.
Thanks and Regards,
Chetan Ranpariya
|
|
|
|
|
|
How to export crystal report to excel in asp.net 1.0?
Is there any built in functionality to export it in excel.
Thanks in advance,
|
|
|
|
|
Try this On Export Button Click Event:
// Declare variables and get the export options.
ExportOptions exportOpts = new ExportOptions();
ExcelFormatOptions excelFormatOpts = new ExcelFormatOptions ();
DiskFileDestinationOptions diskOpts = new DiskFileDestinationOptions();
exportOpts = orpt.ExportOptions;
// Set the excel format options.
excelFormatOpts.ExcelUseConstantColumnWidth = true;
exportOpts.ExportFormatType = ExportFormatType.Excel;
exportOpts.FormatOptions = excelFormatOpts;
// Set the disk file options and export.
exportOpts.ExportDestinationType = ExportDestinationType.DiskFile;
diskOpts.DiskFileName = fname;
exportOpts.DestinationOptions = diskOpts;
orpt.Export ();
Hope this helps u...
|
|
|
|
|
Hi all,
i want to know that,
How to insert one table records from one database to another table in other database using webservices in vb.net or C#.
ex: databse name: PRS1
table name: sample1
|
|
databse name :PRS2
table name : sample2
|
|
|
|
|
I don't know why you want to use webservice.
But easy way is to use Datatable to store Temporarily data.
This can work if both databases are on same domain.
I use free sqlhepler class to connect with database.
------------------------------------------------------------------------------
string sql="Select user_id,name from user_master";
DataTable dt = SqlHelper.ExecuteDatatable(SqlHelper.ConnectionStringfordatabase1, CommandType.Text, sql);
foreach (DataRow dr in dt.Rows)
{
sql = "Inser into user_master (user_id,name) values('" + dr["user_id"] + "','" + dr["name"] + "')";
SqlHelper.ExecuteNonQuery(SqlHelper.ConnectionStringfordatabase2, CommandType.Text, sql);
}
------------------------------------------------------------------------------
Regards,
Mayank Parmar
Senior Software Engineer
Amba Tech
Gandhinagar, India
|
|
|
|
|
hi friends
i did chat window.how to connect other systems
can u help me???
|
|
|
|
|
Hey guys i have a little problem to be needed to solve..
I have a accessdatasource and dropdownlist and i binded them to eachother. After i change the selected index on dropdownlist,after postback the selected index wont come as i choose. The first index is coming as a default selected index after every postback...
what should i do to pass over it?
|
|
|
|
|
I hope you have given datasource to dropdown in
----------------------------------
protected void Page_Load(object sender, EventArgs e)
{
if(!IsPostBack)
{
dropdown.datasource=dc;
dropdown.databind;
dropdown.datatextfield=dtf;
dropdown.datavaluefield=dvf;
}
}
Regards,
Mayank Parmar
Senior Software Engineer
Amba Tech
Gandhinagar, India
|
|
|
|
|
|
I did but the problem is still appearing ... and there is another way besides coding ?
|
|
|
|
|
Thanks it seems gonna work
|
|
|
|
|
|
Paste your code we will check it out and tell.
Regards,
Satips.
|
|
|
|
|
need a guide on how an event in asp.net 2.0 can play .mp3 or other media file
thanks for your help
t.aransiola
|
|
|
|
|
You need to embed windows media player in your web page. There's no ASP.NET code to do this, as ASP.NET all runs on the server. You need to generate HTML that embeds the control in your page, and plays your file. Obviously, you can do it in ASP.NET, but ASP.NET won't be doing it in any platform dependant way.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Is there any way to optimize GIF Image without using GIFBOT or third party??
|
|
|
|
|
What is an optimised GIF ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
You know that it's really bad manners to start a new thread about something that you've posted on recently. If the answer below wasn't satisfactory then you should have continued on that post.
Deja View - the feeling that you've seen this post before.
|
|
|
|