|
Write a Javascript function onmouseover for the particular cell. Then use AJAX to do further
Regards,
Sylvester G
Senior Software Engineer
Xoriant Solutions
sylvester_g_m@yahoo.com
|
|
|
|
|
Hi,
Add an event RowDataBound for the GridView. (hope you know how to add this).
And you can add onmouseover event for each cell. Write javascript function as given below:
1. GridName: GridViewList
2. Event: GridViewList_RowDataBound
For example:
protected void GridViewList_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Cells[0].Attributes.Add("OnMouseOver", "alert('here'); return false;");
//Change the column index as your wish
}
}
Place mouse hand on the first column, you will get popup message 'here'.
To call javascript function and also pass some value from the cell value, replace above single line as below
string StrJavascript = "";
StrJavascript = "return CallMethod(" + e.Row.Cells[0].Text.ToString() + ")";
e.Row.Cells[0].Attributes.Add("OnMouseOver", StrJavascript);
Hope this is clear.
- Harini
|
|
|
|
|
Great. Good you explained very well thru code
Regards,
Sylvester G
Senior Software Engineer
Xoriant Solutions
sylvester_g_m@yahoo.com
|
|
|
|
|
|
Is it possible to format the layout of a Formview control with a multiview control?
I am getting errors from VWD trying to do so.
Can anyone help me out
Thanks
The test of the pudding is in eating it.
|
|
|
|
|
I am new to Visual studio 2005. In previous versions of Visual Studio, whenever you build a web application in debug mode, automatically a dll of the application used to get added in bi\debug folder.
Now in 2005 how do we create this dll?
please let me know ASAP.
Nana
|
|
|
|
|
Build menu --> Publish web site.
Or
open visual command promt.and write
aspnet_compiler -p "c:/inetpub/wwwroot/applicationname" -v \ c:/appName
Pathan
|
|
|
|
|
But there is no dll?
Nana
|
|
|
|
|
Hi,
I'm working on a asp.net project with a datagrid. I want the user to be adding data into Sql database using the datagrid. So I'm using a ListBox to do this and edit update and delete. I placed listbox in EditItemTemplate and label in ItemTemplate. but when I try now to edit it does not bring the lisbox but i can read the grid with the sql content. my code actually looks like this:
public void Edit_dgid(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
dgid.EditItemIndex = e.Item.ItemIndex;
BindDataGrid();
}
public void Cancel_dgid(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
dgid.EditItemIndex = -1;
BindDataGrid();
}
public void Update_dgid(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
System.Web.UI.WebControls.ListBox st=new System.Web.UI.WebControls.ListBox();
st=(System.Web.UI.WebControls.ListBox)e.Item.Cells[5].FindControl("lbachobj");
System.Web.UI.WebControls.ListBox st1=new System.Web.UI.WebControls.ListBox();
st=(System.Web.UI.WebControls.ListBox)e.Item.Cells[4].FindControl("lbobj");
SqlCommand myCommand=new SqlCommand();
myCommand.Connection=con;
myCommand.CommandText="insert into Object,AchievedObject where @Object,@AchievedObject";
myCommand.Parameters.Add(new SqlParameter("@AchievedObject",SqlDbType.Text));
myCommand.Parameters["@AchievedObject"].Value=st.SelectedValue;
myCommand.Parameters.Add(new SqlParameter("@Object",SqlDbType.Text));
myCommand.Parameters["@Object"].Value=st1.SelectedValue;
con.Open();
myCommand.ExecuteNonQuery();
con.Close();
dgid.EditItemIndex=-1;
BindDataGrid();
}
Thanks.
|
|
|
|
|
Hello,
We have created user control using data grid in VB.Net. In this datagrid we are dispalying for each row edit and delete icon.
If user does not have access then we don't want to display edit & delete icon, but some blank space is coming in place of icons.
We don't want this blank space if user does not have access for edit & delete.
Can somebody give sample code how to remove that blank space.
Thanks & Regards,
Kumar
|
|
|
|
|
Hide the Datagrid column instead of hiding the icons,
Add the code below on Page_Load.
<br />
If IsUserHasAddDelEditAccess = False Then<br />
<br />
'Hide Columns for Add, Edit and Delete<br />
<br />
'Add Column<br />
DataGrid1.Columns(10).Visible = False<br />
<br />
'Edit Column<br />
DataGrid1.Columns(11).Visible = False<br />
<br />
'Delete Column<br />
DataGrid1.Columns(12).Visible = False<br />
<br />
End If<br />
Regards,
Mark
|
|
|
|
|
Another Option for you.
1. Add an image and imagebutton to your datagrid add column
2. Set the image visibility to false. this image will represent a user have no access.
3. Override the DataGrid ItemDataBound Event. for your reference see the code below.
Private Sub DataGrid1_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles DataGrid1.ItemDataBound<br />
<br />
<br />
If IsUserHasAddDelEditAccess = False Then<br />
<br />
Dim imgbAdd As ImageButton = CType(e.Item.Cells(0).FindControl("imgButtonAdd"), ImageButton)<br />
imgbAdd.Visible = False<br />
<br />
Dim imgAddGrey As WebControls.Image = CType(e.Item.Cells(0).FindControl("imgAddGrey"), WebControls.Image)<br />
imgAddGrey.Visible = True<br />
<br />
' Do the same thing with Edit and Delete<br />
<br />
End If<br />
<br />
<br />
End Sub<br />
<br />
<br />
Regards,
Mark
|
|
|
|
|
Thanks a lot. First one code is working for us.
Thanks & Regards,
Kumar
|
|
|
|
|
Respected Gurus
in frmShowRefForm.aspx
Public ReadOnly Property getRef_No() As String
Get
Return txtRefNo.Value
End Get
End Property
this property returns the value of txtRefNo.
This property works fine if i m using it on the same page.
But not from other page from where i want to access the value of txtRefNo.
in page_load event of other page
Dim obj As frmShowRefForm
obj = New frmShowRefForm
Dim ref_no As String
If obj.getRef_No <> "" Then
ref_no = obj.getRef_No
End If
Error"Object Reference not set to an instance of an object."
this error comes while returning the value of the textbox of frmShowRefForm.
I have tried to return a string variable from the property instead of the textbox value and it works fine..
Plz guide
|
|
|
|
|
You will need to do a Server.Transfer in order to maintain the other pages's values then you will need to do something with the Context.Objectsendingpage in order to access the pages in this way I believe.
Cleako
|
|
|
|
|
i have a datafield of date time but i want to display only the date.
how do we split this string .
thanks in advance
|
|
|
|
|
DateTime.Now.ToShortDateString().ToString();
Regards,
Sylvester G
Senior Software Engineer
Xoriant Solutions
sylvester_g_m@yahoo.com
|
|
|
|
|
date_datafield.ToString("MM/dd/yyyy");
Regards,
Mark
|
|
|
|
|
Hi
Date Time in any format.
Example:
System.Globalization.DateTimeFormatInfo DFI = new System.Globalization.DateTimeFormatInfo();
DFI.ShortDatePattern = "MM/dd/yyyy";
String StrDate = DateTime.Now.ToString("d", DFI);
Harini
|
|
|
|
|
I have created 2 forms then in first form I am creating object of second form
Then When Second form will be closed at that time i want to make changes in first
form then how can i do it?
I mean which events should be written?
Anita
|
|
|
|
|
you can use like this <body onunload="javascriptfunction()">
Regards,
Sylvester G
Senior Software Engineer
Xoriant Solutions
sylvester_g_m@yahoo.com
|
|
|
|
|
Then this is the wrong place to post a message. Post it under C#
Regards,
Sylvester G
Senior Software Engineer
Xoriant Solutions
sylvester_g_m@yahoo.com
|
|
|
|
|
.NET 2003
We have a requirement to read an html file stored in a folder and display it in an aspx page. When printout is taken, we have need to have header and footer(dynamic) in all the printed pages. Will that be possible to manipulate browser's(IE/Firefox/Netscape) header and footer so that it appears on all the pages? Can this be achieved using Crystal Reports? Will that be possible to read HTML file and show its contents in Crystal Reports based on the URL passed as a parameter to Crystal Reports?
|
|
|
|
|
|