|
Thanks for the reply. can you please a sample code please?
Regards
Naina
Naina
|
|
|
|
|
Christian Graus wrote: You'd have to define a tooltip as a grid view
CG, intellisense tells me that tooltip property for the gridview is a string. Am I missing out on something? Is there a way to set a control as a gridview tooltip?
It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD
|
|
|
|
|
He wants to set it up per row, so I'm imagining there's an HTML way to do that, which he'd have to do in his own template, and either embedd a gridview in there, if that's possible, or build a string and assign it to the value for that row.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
That one went over my head.
It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD
|
|
|
|
|
You can have a hidden div containing the gridview that will be shown as tooltip. Then in the RowBound event, you can bind the tooltip gridview. Then add a javascript method as mouseover (or something like that) event handler for the gridview in the page. This javascript would should display that div at the mouse location. You will also need another event handler to hide the div when mouse is out of the row.
It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD
|
|
|
|
|
As per my understanding with what you have told, i will take seperate div and inside div add gridview2(keeping in mind this is not a nested gridview)
on row databound of gridview1 i will bind the gridview2 the related data of the row from database. and on mouse hover call a javascript function which will make the div visible and show as tooltip. i will try this and will let you know the result how fas i could succeed this.
Regards
Naina
Naina
|
|
|
|
|
Hi
I tried with the way told , but on mouse hover the grid is showing the last binded values but not the corresponding values of the row.
Below is how i have done
<asp:Gridview id = parentgridview>
bound the columns
<Gridview>
<div>
<gridview id ="tooltip">columns</gridview>
</div>
on rowdatabound of parentgridview()
{
tooltip.datasourse = colcollection;
tooltip.databind();
e.row.attributed.add("onmouseover",Showtooltip()");
}
This is what i have done.
Regards
Naina
Naina
|
|
|
|
|
Following should explain what I meant:
<pre><div>
<asp:GridView ID="gridView" runat="server">
</asp:GridView>
<script type="text/javascript">
function ShowToolTip(email){
document.getElementById("emailCell").innerText=email;
document.getElementById("tooltip").style.display="block";
}
function HideToolTip(){
document.getElementById("tooltip").style.display="none";
}
</script>
<div id="tooltip" runat="Server" style="display: none;">
<table id="tooltiptable">
<tr>
<td id="emailCell">
</td>
</tr>
</table>
</div>
</div></pre>
and in cs file:
<pre> List<string> email = new List<string>();
protected void Page_Load(object sender, EventArgs e)
{
gridView.RowDataBound += new GridViewRowEventHandler(gridView_RowDataBound);
email.Add("a@b.com");
email.Add("s@b.com");
email.Add("d@b.com");
email.Add("f@b.com");
email.Add("g@b.com");
List<string> lst = new List<string>();
lst.Add("a");
lst.Add("s");
lst.Add("d");
lst.Add("f");
lst.Add("g");
gridView.DataSource = lst;
gridView.DataBind();
}
protected void gridView_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Attributes.Add("onmouseover", "return ShowToolTip('" + email[e.Row.RowIndex] + "');");
e.Row.Attributes.Add("onmouseout", "return HideToolTip();");
}
}</pre>
It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD
|
|
|
|
|
Hi
Thanks for the reply and sorry for the late reply.
By the code you have given i understand that you are displaying the emailid which is a text as tooltip.
"e.Row.Attributes.Add("onmouseover", "return ShowToolTip('" + email[e.Row.RowIndex] + "');");"
But ratherthan email id my requirement is to show a gridview as tooltip. If this is not possible i need to see an alternative for displaying the gridview as child of that particular row.
Regards
Naina
Naina
|
|
|
|
|
currently i m using asp.net 2.0 with sql server 2000.
while executing the below coding....
SqlTransaction trans = null;
trans = conn.BeginTransaction();
sqlCmd = new SqlCommand("INSERT INTO A(...) VALUES (...)", myCon.ReturnConnection());
sqlCmd.Transaction = trans;
sqlCmd.ExecuteNonQuery();
sqlCmd = new SqlCommand("SELECT IDENT_CURRENT('A')", conn);
int New_AutoID = int.Parse(sqlCmd.ExecuteScalar().ToString());
sqlCmd.Dispose();
trans.commit();
i m getting the below error
ExecuteScalar requires the command to have a transaction when the connection assigned to the command is in a pending local transaction. The Transaction property of the command has not been initialized.
help me plz.. i m trying to fetch the inserted records autoid using transactions. how can i achieve it?
- Karan
|
|
|
|
|
Karan_TN wrote: sqlCmd = new SqlCommand("SELECT IDENT_CURRENT('A')", conn);
This recreates the command object, this losing all your previous settings. I therefore assume this line has the error because you need to do:
Karan_TN wrote: sqlCmd.Transaction = trans;
again
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
CODE PROJECT ROCKS !!
|
|
|
|
|
I have about 1000 page of images scanned from a directory. I have to convert them to records in a sql server table with following fields: Name, Address, Phone. Is it possible to do it? I want to display the results in an ASP.NET page.
Does anybody know how to do it? Where should I be looking?
|
|
|
|
|
ROTFL !!! Good one, it nearly got me.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
May be he need an OCR tool? There are some third party libraries like component source. But I am not sure how hard it to implement in asp.net environment
|
|
|
|
|
It's a joke post, it's following on from something that was just posted in the lounge.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
hi,every one,
i wanna create a page.
that uses the listbox and listbox.value(data fetch from table) and then listbox selected value ,add to the textbox.text like a field.
my user want can delete latest data in textbox.text via a button.
please help me.
modified on Thursday, October 29, 2009 8:43 PM
|
|
|
|
|
'my user' means you're being paid for this, so presumably you have some idea what you're doing. What have you tried and where are you stuck ? I'm not sure I even follow the requirement - you type into the textbox and then delete text in the textbox ? Do you mean that something happens to the text in the listbox ? What is the exact requirement ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
You modified your post rather than answer me. If I get this right, your client wants when you click on an item in the listbox, it appears in a textbox. You said you wanted to edit the textbox before, but you removed that part. Do they want to edit the text and thus edit the listbox item ? Do they want the button to clear the textbox, or remove the item from the listbox, or both ? Do they want to be able to enter the text of an item manually and delete it ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
If you're not going to try to write any code and you're not going to answer us, then your best bet is to contact the client and tell them you're not really a programmer after all.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Turns out my previous solution was a trip down an evil rabbit hole due to reusing a global variable from my JavaScript in my code behind (doh).
Here is the corrected solution, which is a bit uglier:
First, in the custom control I made a public property for the listbox ClientID within the control I wished to access in my Javascript:
public partial class Controls_Locations : System.Web.UI.UserControl
{
public ListBox Locations
{
get {return lbControlVehicles.ClientID; }
}
Then in my page code behind I provided a public property for this listbox ClientID string:
private Controls_Locations userLocations;
public string UserVehiclesListBox
{
get { return userLocations.Locations; }
}
In my Page_Load I initialize userLocations:
protected void Page_Load(object sender, EventArgs e)
{
if (Page.IsPostBack == false)
{
userLocations = this._Locations1;
In my aspx file using Javascript:
<uc1:RastracUserVehicle_Locations ID="RastracUserVehicle_Locations1" runat="server" />
<script type="text/javascript" language="javascript">
var myLocationList;
function getLocationListBox()
{
myLocationList = $get("<%=UserVehiclesListBox%>");
}
</script>
I used a "global" Javascript variable so that I only need to get the list once. I have not yet discovered whether accessing the list will cause a post back to the server everytime.
|
|
|
|
|
Hi All
I have developed my first website. Now it is staying at my local computer. I am excited to keep it in World Wild Web(WWW).
To do that I already have done following jobs
---I bought a domain and 500MB memory
---Received a message from seller to use the control panel
Here is my problems
I don't know which file and folder should upload bia control panel
(There are 4 projects in whole solution 1. koorasweb, 2.kooraswedtest,3.koorascore, 4.koorascoretest.)
I don't know how can I connect my database properly.
Please help me......
shahdat
|
|
|
|
|
|
Thanks for ur valuable response.
But
I have no clear concept about uploading my applications.I don't know which file and folders should be uploaded. My project build on Layered Architecture
There are 2 main project
1. koorasweb -for presentation layer
2. koorascore - for service, domain/business, domain and dataaccess layer
should I upload both koorasweb and koorascore? or only files and folders of koorasweb project?
shahdat
|
|
|
|
|
You need to upload the files into wwwroot, if not specified from IIS console explicitely.
The default website location points to wwwroot directory..
If you have filemanager to upload, then dont bother about the root directory, just upload the files.. create folder just following your directory structure .
After you upload everything.. I hope it will work.
|
|
|
|