|
Hi i am using grid selection index change event...,
when i click a cell value, those values coming to my textbox,
same time grid losing its cursor point...,
it mean if i am showing 50 records in my grid..,
when i select 40th record the value comr yo my textbox and its showing the grid from first data..,
but it have to point in 40th only...,
how to do this?
Thanks & Regards,
NeW OnE,
please don't forget to vote on the post
|
|
|
|
|
Can you not use setfocus to set the focus to a specific record in the grid?
We are not a Code Charity
|
|
|
|
|
Hi,
I have a datagrid to which a database table called "employee" need to be binded. there are 9999 records in my table.while i bind the datagrid it takes several minutes for it to load...
is there any other ways to improve its performance so that i can reduce the time of loading the page??
plz reply ASAP...
Thanx in advance,
zari
|
|
|
|
|
Well, one common sense UI decision would be to not have 10,000 records in your grid.
The datagrid is designed for common UI tasks. If you need to load 10,000 records, you need to find a commercial grid that deals with this ( essentially by only loading small subsets of that data at a time )
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
This seems to be a common question in this forum.
Why not cut down the number of records by filtering them, maybe on search criteria by a user.This way not so many are being binded to a datagrid
Other then that follow the advice of CG
We are not a Code Charity
|
|
|
|
|
I'm creating a multilingual website so I'm trying to dynamically include the language related stylesheet. As you might have already expected, I do this in the page head using a link tag. Well, for some reason I'm not aware of, the code below doesn't work (when I move it outside the the page head, it works though!):
<link rel="stylesheet" href="/css/<%= _language.Stylesheet %>" type="text/css" media="screen" />
It gives this output:
<link rel="stylesheet" href="/css/<% _language.Stylesheet %>" type="text/css" media="screen" />
On the other hand this code works perfectly:
<link rel="stylesheet" href=<%= string.Format("\"/css/{0}\"", _language.Stylesheet) %> type="text/css" media="screen" />
This is really weird, can anybody explain what's going on?!!
P.S. This is ASP.NET 2.0
UPDATE
When tried to remove runat="server" from the head tag, it actually worked! The problem is that I set the page title in my code so I have to keep runat="server" in the head tag, it seems like a bug to me, what do you think?
modified on Thursday, June 26, 2008 6:36 AM
|
|
|
|
|
The problem is one is <% and the other is <%=
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Thanks for noticing this (I modified the post after reading your post), but actually this is not the problem, it still give the same output!
|
|
|
|
|
I haven't had such an issue. you can add stylesheets from code behind page. Try that instead of doing this.
|
|
|
|
|
Thanks for your reply but actually the problem is already solved (read the post till the end), I just wanted to understand what was going on
Regards
|
|
|
|
|
I try to run "http://localhost/localstart.asp" but i can't run it with iis 5.0(my machine os is win xp pro sp2 with iis 5.0).
and i got this error
Server Application Error
The server has encountered an error while loading an application during the processing of your request. Please refer to the event log for more detail information. Please contact the server administrator for assistance.
So, i decide to reinstall iis and vs.net 2008 and install
- iis
- vs.net 2008
respectively,
for hope that it would re-map iis and asp.net. (- -)!
i've also give ASPNET permission to the virtual directory folder and choose ASP.NET version for it.
but i still didn't work and got the Server Application Error again .
any ideas
thank
^^
|
|
|
|
|
Check out this post on the forum
This might be what you want:
http://forums.asp.net/t/936217.aspx
We are not a Code Charity
|
|
|
|
|
at the moment i am using this but it is not working.
code to populate 1st ddl from sql server
Table format:
FruitCat nvarchar(50)
FruitName nvarchar(50)
<br />
Private Sub GetFruitsCat()<br />
<br />
Dim objConnection As SqlConnection = New _<br />
SqlConnection("Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=MyDB;Data Source=MyServer\SQLEXPRESS")<br />
<br />
objConnection.Open()<br />
<br />
Dim myCommand As New System.Data.SqlClient.SqlCommand()<br />
myCommand.Connection = objConnection<br />
<br />
myCommand.CommandText = "SelectAllTheFruitsCat"<br />
myCommand.CommandType = CommandType.StoredProcedure<br />
<br />
Dim param As New System.Data.SqlClient.SqlParameter()<br />
<br />
<br />
Dim myAdapter As New SqlDataAdapter(myCommand)<br />
<br />
myAdapter.Fill(DataSetOfAllTheFruitsCat)<br />
<br />
<br />
Dim reader As SqlDataReader = myCommand.ExecuteReader()<br />
<br />
<br />
DDLFruitsCat.DataSource = DataSetOfAllTheFruitsCat<br />
<br />
DDLFruitsCat.DataTextField = "FruitCat"<br />
<br />
DDLFruitsCat.DataBind()<br />
<br />
objConnection.Close()<br />
<br />
End Sub<br />
This is the code to get Fruit depending on the fruit category selected in the 1st DDL
<br />
Private Sub GetFruits()<br />
Dim objConnection As SqlConnection = New _<br />
SqlConnection("Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=MyDB;Data Source=MyServer\SQLEXPRESS")<br />
<br />
objConnection.Open()<br />
<br />
Dim myCommand As New System.Data.SqlClient.SqlCommand()<br />
myCommand.Connection = objConnection<br />
<br />
myCommand.CommandText = "SelectASpesificCatFruit"<br />
myCommand.CommandType = CommandType.StoredProcedure<br />
<br />
Dim param As New System.Data.SqlClient.SqlParameter()<br />
<br />
<br />
param = myCommand.Parameters.Add("@FruitCat", _<br />
SqlDbType.NVarChar)<br />
param.Direction = ParameterDirection.Input<br />
param.Value = DDLFruitCat.Text<br />
<br />
Dim myAdapter As New SqlDataAdapter(myCommand)<br />
<br />
myAdapter.Fill(DataSetOfFruit)<br />
<br />
Dim reader As SqlDataReader = myCommand.ExecuteReader()<br />
<br />
DDLFruit.DataSource = DataSetOfFruit<br />
<br />
DDLFruit.DataTextField = "FruitName"<br />
<br />
DDLFruit.DataBind()<br />
<br />
objConnection.Close()<br />
End Sub<br />
i am calling GetFruits here
<br />
Protected Sub DDLFruitsCat_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DDLFruitsCat.SelectedIndexChanged<br />
GetFruits()<br />
End Sub<br />
2nd ddl is not changing according to data in 1st ddl.
|
|
|
|
|
OK, this isnt a fix to your problem but an alterntive solution.
Try the ajax cascading dropdown, very useful for what you want
http://www.asp.net/ajax/ajaxcontroltoolkit/samples/CascadingDropDown/CascadingDropDown.aspx
We are not a Code Charity
|
|
|
|
|
Have you set a breakpoint to see why it's not working ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Populate 2nd drop dowl list in the selectedIndex Chnage event of 1st drop down list
And also check whether AutoPostback is set in 1st drop down list(i.e AutoPostback = true)
Thanks,
Arindam D Tewary
|
|
|
|
|
Meax wrote: param.Value = DDLFruitCat.Text
What is DDLFruitCat object? is It TextBox?
regard
kHan
please don't forget to vote on the post that helped you.
|
|
|
|
|
DDLFruitsCat_SelectedIndexChanged
It is a DropdownList only
|
|
|
|
|
S herin wrote: It is a DropdownList only
He has only two dropdownlist. one is DDLFruitsCat and second is DDLFruit.
and I asked about DDLFruitCat.
DUmp...........
please don't forget to vote on the post that helped you.
|
|
|
|
|
You are right
But will anybody use DDL(DDLFruitsCat) for a textbox.
May be.....
|
|
|
|
|
ROTFL !!!!
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
what does this mean?:
Christian Graus wrote: ROTFL !!!!
We are not a Code Charity
|
|
|
|
|
Not an ASP.Net question
Roll On The Floor Laughing
|
|
|
|
|
Where you are calling GetFruitsCat()
If it is in pageload, That will be a problem.
|
|
|
|
|
You are right. If he calls it in page load, every time, then his selected index will reset to 0
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|