|
kidus12 wrote: Any help?
Show the code you are using, then maybe we can help. I don't understand how are you creating this "clickable gridview" in javascript?
only two letters away from being an asset
|
|
|
|
|
hi
here is the code for creating the clickable Row using Javascript
if (e.Row.DataItemIndex == -1)
return;
e.Row.Attributes.Add("onMouseOver",
"this.style.cursor='hand';");
e.Row.Attributes["onmouseover"] =
"javascript:setMouseOverColor(this);";
e.Row.Attributes["onmouseout"] =
"javascript:setMouseOutColor(this);";
e.Row.Attributes.Add("onclick",
this.GetPostBackClientEvent(GrdDynamic,
"Select$" + e.Row.RowIndex.ToString()));
and what I want to do is to hyperlink to other page when the row in the clickable gridview is clicked and passed the contents of the clicked row to the other page(using session).
thanks
kidus
|
|
|
|
|
You are trying to make it more difficult than it is. Use a template column or Hyperlink column to create the link, pass the id of the row to the next page and retrieve the row data from the datasource on that page.
only two letters away from being an asset
|
|
|
|
|
hi
pls ..... some small example
thanks
kidus
|
|
|
|
|
I already have. Figure it out. It isn't that difficult.
only two letters away from being an asset
|
|
|
|
|
Hi
You can Create a HyperLinkField column(s) for GridView.
Cheers
Chandu
|
|
|
|
|
I think I am missing something small, and I can't figure it out. Can anyone help? I am looping through a gridview pulling out a data field and putting it into an arraylist. Then putting that array list later into a string var. My code is as follows:
Dim emailaddresses = New ArrayList
Dim Key
For Each gvr As GridViewRow In GridView1.Rows
Key = GridView1.DataKeys(0)
emailaddresses.Add(Key.value.ToString())
Next gvr
'Trim Size
emailaddresses.TrimToSize()
Dim strMain As String ' Will be used to populate email address in message
Dim iList As Integer ' Var to count through the array
Dim iCount As Integer ' Count of recs in array
iList = 0 ' set iList to 0
'strMain = ""
iCount = emailaddresses.Count() ' get size of array
Do Until iList = iCount
'Populate string with array record
strMain = strMain & emailaddresses.Item(iList) & ","
emailaddresses.Remove(iList)
'Count up 1
iList = iList + 1
Loop
My problem that I am having is no matter how many records are in the array the first record populates all of the array. So if my grid has 5 unique values, it will display 5 items, but all are the first record from the gridview, not 5 different items. I think this has something to do with the way I am looping through the gridview. This is ASP.NET 2.0.
THANKS!
BJJONESEY
|
|
|
|
|
bjjonesey wrote: Do Until iList = iCount
'Populate string with array record
strMain = strMain & emailaddresses.Item(iList) & ","
emailaddresses.Remove(iList)
'Count up 1
iList = iList + 1
Loop
Reverse the looping,
iList = iCount - 1<br />
Do Until iList < 0<br />
'Populate string with array record<br />
strMain = strMain & emailaddresses.Item(iList) & ","<br />
emailaddresses.Remove(iList)<br />
'Count up 1<br />
iList = iList - 1<br />
Loop
|
|
|
|
|
Thanks for the response. That works!
Ben Jones
|
|
|
|
|
I need to iterate through the rows in a datagrid and record the number of rows that are checked (checkboxes in a templatecolumn). I need to do that on the client side. The object of this is to either submit if none of the checkboxes are checked or prompt the user to save records (via javascript confirm). The code-
function dtgValidateCheckBox(grdid, objlist)
{
//if user clicks on "Search", then this method
//will check to see if there are products
//selected but not saved. User is prompted
//to either continue and loose items in the cart
//or cancel and then click on save items to cart.
//attribute is added from the server side to fire this method.
var chkbox;
var i=20;
var iCount=0;
chkbox=document.getElementById(grdid + "__ctl" + i + "_" + objlist);
while(chkbox!=null){
if(chkbox.checked == true)
{
iCount++;
}
i=i+1;
chkbox=document.getElementById(grdid +
'__ctl' + i + '_' + objlist);
}
if(iCount>0)
{
return confirm("There are unsaved items in your cart. Do you wish to continue?");
}
}
Any Ideas?
|
|
|
|
|
hi wood0601
just try to send count of rows in grid and pass the value to javascript. I hope it will easy to u.
k.ravi sankar
|
|
|
|
|
Thanks priyaram1. Not sure how. Do you have any example code?
|
|
|
|
|
This sample script for validating the textboxes in datagrid.
function quanvalid(k)
{
var a = new Array(k);
var count =2;
var sam;
var falge=0;
for(var i=0;i<k;i++)
{
="" if(count="" <="" 10)
="" count="0" +count;
="" }
="" a[i]="CtrlPOUpdateControl1_POGrid_ctl" +count+'_txtqtynow';
="" sam="document.getElementById(a[i]).value;
" if(sam="" !="0)
" return="" true;
="" count++;
="" alert("should="" enter="" quantity");
="" false;
="" }
=""
<div="" class="ForumSig">k.ravi sankar
|
|
|
|
|
priyaram1. Thanks for the info. Your example gave me what I needed!
|
|
|
|
|
Is it a wise idea to use master page in a website. The name mangling problem in master page will affect the JavaScript and CSS style. The designer’s logics will sometimes breaks when the web developer applies master pages.
My question is :
1. how to solve name mangling problem
2. Keeping the JavaScript code as separate .js file (better solution for traffic and maintains)
3. Advantages and disadvantages in using master pages
4. performance
Does every one prefer using master pages? After reading several articles I am still confused on using master pages. Advice me...
|
|
|
|
|
You can replace the control's name in the page load event like this:
abstract string script = "[Label1ID].innerHTML = 'Hello!';";
abstract string scriptKey = "SayHello";
abstract bool addScriptTags = true;
protected void Page_Load(object sender, EventArgs e)
{
script = script.Replace("[Label1ID]", Label1.ClientID);
ClientScript.RegisterStartupScript(this.GetType(), scriptKey, script, addScriptTags);
}
|
|
|
|
|
1) What do you mean? How does it affect CSS and JavaScript?
2) Why can't you?
3) Advantages: Conformity throughout the application.
4) Not an issue
only two letters away from being an asset
|
|
|
|
|
Hi,
1. if we add a text box named as "TextBox1" inside a content page "ContentPlaceHolder1". Then asp.net generate the name "ctl00_ContentPlaceHolder1_TextBox1" on run time. This name mangiling problem will affect the javascripts that written by using the 'TextBox1'. the CSS that applies to a particual named tag (#topImage) will also get effected.
2. if name mangiling happens how can use the below script inside a .js file
var textbox1 = document.getElementById('TextBox1');
3. yes i agree with that. How to seperate programmer and designer logics.
4. i agree with that
|
|
|
|
|
The name mangaling is not a cause of using a master page. Using any container will cause this so as to uniquely identify the control on the page. You just have to understand this process and code accordingly. I have never had a problem with this, in javascript or with dynamic CSS.
only two letters away from being an asset
|
|
|
|
|
I have a details view that a user is editing a txt box called txtComments. When they hit update it is writing those comments to a db. I also want to write those comments to an audit table. So during DetailsView1_ItemUpdating I am having it write to another table. How can I get the contents of txtComments into my db? Is there a dtv.field command or something I can call?
-- modified at 12:04 Wednesday 13th June, 2007
Never mind I figured it out. For others to pull items out of the Details view, set another field as a data key and the following syntax will drop it to a variable:
DetailsView1.DataKey(1)
Where (1) is the key id of the field you are trying to pull. Remember you start off with 0!
BJJONESEY
|
|
|
|
|
hello:
i wanna ask if i can get the installer of the print activeX of crystal report,
iam developing a website using asp.net and installed it on a server. when i tried to access the website from a client PC the report didnt printed. i think its because of the activeX component is missing.
the client is connected through a network with the server and dont have an internet connection
have any idea why the report didnt printed or how to get the activeX installer of the print crystal report. thanx
|
|
|
|
|
I have a template column in a grid view with a button that has the command name set to "Edit". I handle the button click event myself and do not want the grid to fire the RowEditing event. Is there any to turn this default behavior off?
-Mike.
|
|
|
|
|
hi
in the RowEditing Event write
Grid.EditRowIndex = -1;
bye
|
|
|
|
|
Thanks, but not exactly what I'm looking for. I want to stop the event form firing all together.
-Mike.
|
|
|
|
|
I've written a session state provider and tested it in my own app. I now want to set it up to work from within an ASP.Net Application.
My class derives from SessionStateStoreProviderBase and is in an assembly that is referenced from my ASP project and set to CopyLocal true.
I've added this to the web config file inside a sessionState element:
<providers>
<add name="MySqlStateStore"
type="MySQLIntegration,MySqlStateStore"
connectionStringName="ASPSessionState"
writeExceptionsToEventLog="false" />
</providers>
I've tried using a dot or a comma and using the dll name, the namespace, the class name etc in various combinations but I keep getting the following error.
Could not load file or assembly 'MySqlStateStore' or one of its dependencies. The system cannot find the file specified.
Does anyone know what i have to do to the dll or what i have to put in the type attribute in the web.config to get this to work? I've found loads of people asking related questions but not many answers as yet. All the examples i've found on MSDN or elsewhere talk loads about writing the class but seem to think that the web.config just sorts itself out.
Thanks for any help or references anyone can give me
Russell
|
|
|
|