|
Thanks for the reply.
In my case the column count is dynamic. Hence I cannot design a gridview in the aspx.
|
|
|
|
|
Hi guys,
i have a datagrid, i would like to get the value of one column
when user clicks on that row(item) so that i can show the details
of that row(item) on the next page. I have tried the below and
am not so sure how to proceed:
protected void available_ItemDataBound(object sender, DataGridItemEventArgs e)
{
foreach(DataGridColumn col in available.Columns)
{
if (e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.Item)
{
e.Item.Attributes.Add("onmouseover", "this.style.backgroundColor='#F9F9F9' this.style.cursor='pointer';");
e.Item.Attributes.Add("onmouseout", "this.style.backgroundColor='#ffffff';this.style.cursor='pointer';");
}
}
}
Does anyone know how i can manage to get the value of one column in tha
row that has been clicked?
Please help me
Regards
MS
|
|
|
|
|
Assuming your DataGrid is bound to a DataView with a unique ID value for each row,
include a Hypelink in your DataGrid columns - say hypDetails, maybe within a template column -
then you can put in your ItemDatBound code:
DataRow dr = e.Item.DataItem.Row;
HyperLink hypDetails = CType(e.Item.FindControl("hypDetails"), HyperLink);
hypDetails.NavigateUrl = "details.aspx?id=" & CStr(dr("ID"));
This will pass the ID value of that row as a parameter to the next page (details.aspx)
|
|
|
|
|
Thanks alot man, i will give it a try just now.... but unfortunatly
'CType' does not exist in C# only VB...is there an alternative to this?
Regards,
MS
|
|
|
|
|
OMG I've been outed! I'm sure a little Googling will sort you out...
|
|
|
|
|
in c#....
HyperLink hypDetails = (HyperLink)e.Item.FindControl("hypDetails");
|
|
|
|
|
Hi,
How to Change the Color of the Pie Chart in ASP.Net Application.
I have used ASP Charts in my application and the Pie Chart is Filled with some Default Colors. How shall i change them to some Specific Colors??
Please Help me fixing this Issue...
Regards
Sivan.G
|
|
|
|
|
|
I'm sending mail with excel attchment and it's working fine when I run it from my local
machine. but if I try to access it from another machine it's giving me this
Error:
Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80070005 Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)).
Error coming on first line of below code
Microsoft.Office.Interop.Excel.Workbook aBook;
Microsoft.Office.Interop.Excel.Application ExlApp = new Microsoft.Office.Interop.Excel.Application();
i have given all rights still error is coming
please help me out as soon as possible
|
|
|
|
|
It means that your application user does not have necessary permission to open an excel instance. Open DCOM Config, and Grant Launch & Activation permisson, and Access permission to Microsoft Excel Application.
Or you can see this [http://forums.asp.net/t/1303594.aspx]
|
|
|
|
|
i checked the same link and given rights like tht only
still it gives error
|
|
|
|
|
|
|
Grant Access Permission in DCOM Config for Network Service account (Application Pool user)
|
|
|
|
|
|
Keep the question as brief as possible. Also see this [link]
|
|
|
|
|
Hi,
I can see that, in my web.config file, my Entity Model set created the following connection string,
<add name="ConnStrDemo" connectionString="metadata=res://*/Models.SDB.csdl|res://*/Models.SDB.ssdl|res://*/Models.SDB.msl;provider=System.Data.SqlClient;provider connection string='Data Source=SDGSDG-PC\SQLEXPRESS;AttachDbFilename="D:\Demo\WebApp\App_Data\myDb.mdf";Integrated Security=True;MultipleActiveResultSets=True'"
providerName="System.Data.EntityClient" />
Obviously I need to change the data source part when I will deploy my web application my production server. My production server SQL Connection string should be something like this,
Server=XXX.XXX.XXX.XXX;Database=XXX;User ID=XXXX;Password=XXX;
Now, if I change the connection string from my web.config file to
<add name="ConnStrDemo" connectionString="Server=XXX.XXX.XXX.XXX;Database=XXX;User ID=XXXX;Password=XXX;" />
Will everything simply work in my production server ? I am afraid if the metadata part in the connection string is required by the Entity Framework or not. Please advice.
Regards.
|
|
|
|
|
|
Let me guess, you are using IE6. Is it? If so, then there are various issues with IE6. Almost whole world has moved to IE7/IE8. Why are you not?
In case it's not IE6, then how can you say it's a style issue. It looks fine. Did you try a sample POC that a generic issue for you or specific to this very istance? Build a sample and see if it's an issue there too.
|
|
|
|
|
How to replace text with image in word 2007 and save the file in .pdf format
this is my code
_wordapp.ActiveWindow.Selection.WholeStory();
_wordapp.ActiveWindow.Selection.Copy();
IDataObject data = Clipboard.GetDataObject();
string temp = "";
temp = data.GetData(DataFormats.Text).ToString();
temp = temp.Replace("\r", "");
string[] arrtemp = temp.Split(Environment.NewLine.ToCharArray());
int pos = 0;
for (int t = 0; t < arrtemp.Length; t++)
{
if (arrtemp[t].Contains("Sign1"))
{
pos = t;
string fileName = GetSignPath(); //the picture file to be inserted
Object oMissed = _aDoc.Paragraphs[pos].Range; //the position you want to insert
Object oLinkToFile = false; //default
Object oSaveWithDocument = true;//default
_aDoc.InlineShapes.AddPicture(fileName, ref oLinkToFile, ref oSaveWithDocument, ref oMissed);
File.Delete(fileName);
this.FindAndReplace("Sign1", "");
}
}
Its replacing at wrong place instead of where i wanted(i.e. in place of Sign1)
Sign1 is the text given in the Word 2007 to find and replace it with image
Instead it is placing sumwhere else only in the .pdf file
Please suggest me the solution code if possible to solve it
Its urgent
Thanks,
Harish
modified on Wednesday, August 4, 2010 10:21 AM
|
|
|
|
|
|
Why posting it at multiple forums? It is considered rude. Stick to one you find most appropriate for your question.
|
|
|
|
|
I believe you can use the SiteMapPath control in conjunction with your web.config to display a nice trail.
|
|
|
|
|
I want to send a mail message with an attached file. I have to get the file from the user's local computer via FileUpload control.
The real problem is that I have to use a System.Web.Mail.MailMessage object in order to do it, and it's not easy as using System.Net.Mail.MailMessage.
Does someone know how can I do it?
|
|
|
|
|
MailMessage mm = new MailMessage("from_address", "to_address");
byte[] atatchmentFile = FileUpload1.FileBytes;
MemoryStream memStream = new MemoryStream(atatchmentFile);
Attachment attachment = new Attachment(memStream, FileUpload1.FileName);
mm.Attachments.Add(attachment);
string smtpHost = "smtp.gmail.com";
string userName = "your_username@gmail.com";
string password = "your_password";
System.Net.Mail.SmtpClient mClient = new System.Net.Mail.SmtpClient();
mClient.Port = 587;
mClient.EnableSsl = true;
mClient.UseDefaultCredentials = false;
mClient.Credentials = new System.Net.NetworkCredential(userName, password);
mClient.Host = smtpHost;
mClient.DeliveryMethod = System.Net.Mail.SmtpDeliveryMethod.Network;
mClient.Send(mm);
|
|
|
|