|
hi
i have a gridview manually bounded to an accsess db. how can i adjust (in my case reduce) the width of specific columns?
i've tried to set the width for the header,footer and item templates but all it did was narrowing an invisible text area - caused the text to wrap down but the size of the column remained the same...
help on this will be very appreciated..
thanks
j
|
|
|
|
|
try, eg:
....Columns(1).ItemStyle.Width = System.Web.UI.WebControls.Unit.Percentage(30)
or
....Columns(1).ItemStyle.Width = System.Web.UI.WebControls.Unit.Pixel(100)
|
|
|
|
|
thanks Phil but i've tried that and didnt effect the columns width
j
|
|
|
|
|
hmm, well... remember that web-controls are rendered on the page as straight HTML - tables in this case. Take a look at the page source of one of your pages and see the HTML code there - is there an appropriate
<td width="XX">
in there?
Assuming so, remember that the width may still display incorrectly if the other column widths are either not set or are contradictory...
|
|
|
|
|
i've looked at the source code and width is appearing as i've set it, i.e. if i'm using:
gridView.Columns[4].ItemStyle.Width = Unit.Percentage(30);
i'm getting:
td style="width:30%;"
how do you think setting the width issue can be solved?
thanks,
J
|
|
|
|
|
Then something else is throwing it off - you will have to examine the HTML to see what it might be:
- something with a non-variable width (eg an image) that is wider than the column width allocated
- are column widths set for ALL columns?
- if so, are they contradictory (maybe they add up to only 90%, or 110%)
- is an overall table width set? if so, does it tally with the sum of the column widths?
- have you taken table borders, cellspacing and cellpadding into account, as well as margins/borders round objects within (eg images, again)
- is this a browser-specific issue?
All sorts of things can combine to throw off a table display - but at least you know the correct width is being applied via your code. All you need to do is figure out what's wrong in the resultant HTML and adjust things accordingly....
|
|
|
|
|
thanks... i will examine all that i can think of
j
|
|
|
|
|
Hi All,
I was developed a site, in that there is a form enquiry.aspx. The problem is when is try to run the site in dubug mode(By press F5 from my VS) it works fine. Even the enquiry also work fine. But when i uplad the site on the server the mail send option is not working.
What would the problem.
Awaiting for reply
Yogesh Agarwal
|
|
|
|
|
Please post your code for the sending mail event.
It could be that it is only working for localhost
Whats the difference between a triangle and Tottenham Hotspur?
A triangle has 3 points.
|
|
|
|
|
if your are using SMTP for sending emails then verify that you are changing the settings after uploading to the server.
Ahsan Ullah
Senior Software Engineer
|
|
|
|
|
yogesh_kumar_agarwal wrote: But when i uplad the site on the server the mail send option is not working.
Please Check the Configuration of SMTP Server on your Web Server.
cheers,
Abhijit
|
|
|
|
|
I am getting this error while accessing the lotus notes. It is working fine when executes in my system but giving this error while executing in IIS virtual directory.
The error is
Retrieving the COM class factory for component with CLSID {29131539-2EED-1069-BF5D-00DD011186B7} failed due to the following error: 8007000e.
Source Error:
Line 22: protected void btnAddress_Click(object sender, EventArgs e)
Line 23: {
Line 24: Domino.NotesSessionClass sessclass = new Domino.NotesSessionClass();
Line 25: sessclass.Initialize("lotuspwd");//PWD is required
Line 26: Domino.NotesDatabase notesDB = sessclass.GetDatabase("serveraddress", "names.nsf", false);
Thanks for any help.......
Lakshmi
|
|
|
|
|
I have the same problem!!
Do you have found any solution? Thank you.
|
|
|
|
|
Hi,
Any one can suggest any book/ebook/article for designing and implementation of ASP.NET with AJAX.
Thanks in advance,
|
|
|
|
|
Google is the best book
Ahsan Ullah
Senior Software Engineer
|
|
|
|
|
ASP.net ajax
Whats the difference between a triangle and Tottenham Hotspur?
A triangle has 3 points.
|
|
|
|
|
Hi
Please use this linkhttp://www.asp.net/Learn/ajax/[^]">
Cheers!!
Brij
|
|
|
|
|
|
Hi , I m finding Hyperlink Control , which is in Datalist , and this datalist is in GridView .
Is it right
HyperLink H1 = (HyperLink)(This.Page.FindControl("Hyperlink1"));
i write this code in page_load .
|
|
|
|
|
No, that is not correct. You need to find it inside the datalist control.
Apurva Kaushal
|
|
|
|
|
but i have to find it on a page_Load . Any other method 4 that .
|
|
|
|
|
What you need to do is to iterate through all the records in datalist and then find the control you want inside that iteration loop. BTW you cal also use inItemDataBound event to perform action for the rows of the container control.
Apurva Kaushal
|
|
|
|
|
hi,
I am trying to autoformat an Excel (.xls) file and then import it into Sql server 2000 table using C# in Asp.net. But when i try to autoformat the excel file i get the exception "Attempted to read or write protected memory. This is often an indication that other memory is corrupt." Someone please help me to solve this problem
Here is the code.
sing System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
using System.Data.OleDb;
using System.Data.Odbc;
using System.Text;
using Microsoft.Office.Interop.Excel;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
SqlConnection Cn = new SqlConnection("server=193.14.45.137; database= NitDB; User ID=re; Password= g5");
SqlCommand Cm = new SqlCommand("Select * from ExcelFile", Cn);
Cn.Open();
SqlDataReader St = Cm.ExecuteReader();
gdExcelFile.DataSource = St;
gdExcelFile.DataBind();
St.Close();
Cn.Close();
}
public static void PrintProgressBar()
{
StringBuilder sb = new StringBuilder();
sb.Append("<div id='updiv' style='Font-weight:bold;font-size:11pt;Left:320px;COLOR:black;font-family:verdana;Position:absolute;Top:140px;Text-Align:center;'>");
sb.Append(" <script> var up_div=document.getElementById('updiv');up_div.innerText='';</script>");
sb.Append("<script language=javascript>");
sb.Append("var dts=0; var dtmax=10;");
sb.Append("function ShowWait(){var output;output='Reading data from excel...PLEASE WAIT!';dts++;if(dts>=dtmax)dts=1;");
sb.Append("for(var x=0;x < dts; x++){output+='';}up_div.innerText=output;up_div.style.color='red';}");
sb.Append("function StartShowWait(){up_div.style.visibility='visible';ShowWait();window.setInterval('ShowWait()',100);}");
sb.Append("StartShowWait();</script>");
HttpContext.Current.Response.Write(sb.ToString());
HttpContext.Current.Response.Flush();
}
public static void ClearProgressBar()
{
StringBuilder sbc = new StringBuilder();
sbc.Append("<script language='javascript'>");
sbc.Append("alert('Data exported successfully');");
sbc.Append("up_div.style.visibility='hidden';");
sbc.Append("history.go(-1)");
sbc.Append("</script>");
HttpContext.Current.Response.Write(sbc);
}
protected void btnExport_Click(object sender, EventArgs e)
{
PrintProgressBar();
{
OdbcConnection connection;
SqlBulkCopy bulkCopy;
string ConnectionString = @"server=323.65.43.134;database= NitDB; User ID=yu; Password=g0";
string connstr = @"Driver={Microsoft Excel Driver (*.xls)};DriverId=790;Dbq=" + fyle.Value;
using (connection = new OdbcConnection(connstr))
{
string[] temp;
string fn1;
fn1 = System.IO.Path.GetFileName(fyle.PostedFile.FileName); \\ fyle is the Html File upload control
temp = fn1.Split('.');
object missing = System.Reflection.Missing.Value;
Microsoft.Office.Interop.Excel.Application excel = default(Microsoft.Office.Interop.Excel.Application);
Microsoft.Office.Interop.Excel.Workbook wb = default(Microsoft.Office.Interop.Excel.Workbook);
excel = new Microsoft.Office.Interop.Excel.Application();
// I get the exception at the below statement.
wb = excel.Workbooks.Open(fn1, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing);
excel.Visible = true;
//wb.Activate();
excel.Cells.Select();
excel.Columns.AutoFit();
excel.Rows.AutoFit();
OdbcCommand command = new OdbcCommand("Select * FROM [" + temp[0].ToString() + "$]", connection);
connection.Open();
using (OdbcDataReader dr = command.ExecuteReader())
{
using (bulkCopy = new SqlBulkCopy(ConnectionString))
{
bulkCopy.DestinationTableName = "ImportedExcel";
bulkCopy.WriteToServer(dr);
}
dr.Close();
}
}
bulkCopy.Close();
connection.Close();
}
ClearProgressBar();
}
}
Nitin Raj Bidkikar
modified on Wednesday, October 22, 2008 9:11 AM
|
|
|
|
|
Hi everybody:
In my web application,I store some information(UserName etc.) in Session.
In a admin's web page,I want to list all the active Sessions and its data.Also, I wiil be able to stop any Session.
Is there any way?
|
|
|
|
|