|
kalyanPaladugu wrote: How do i make the scrollbar to appear in datagridview
The way you do with the GridView control is similar to the datagrid[^] control.
kalyanPaladugu wrote: How do i make the DataGridView Readonly
The simple way is not to use any editable control in the GridView control, for example with the BoundField you can set the ReadOnly to true ....
|
|
|
|
|
Hi guys iam trying to sorting in the gridview.But its not working its asking me to implement the onsorting event which i am unable to figure out wht to be in that event.I tryed to sort like we used to do in 1.1 but its not working.If any one of u implemented sorting help me with code snippet or guidelines.Thank you.
|
|
|
|
|
Set the AllowSorting property to true. If you don't have any command fields in your gridview, you might want to set the EnableSortingAndPagingCallbacks property to true as well to get a better performance.
Nila
|
|
|
|
|
|
Is there a way to add an existing web so that it doesn't name it 'existingweb_1'? Why can't it just add the web as is without changing the name!!
ed
~"Watch your thoughts; they become your words. Watch your words they become your actions.
Watch your actions; they become your habits. Watch your habits; they become your character.
Watch your character; it becomes your destiny."
-Frank Outlaw.
|
|
|
|
|
Hi there,
Do you mean you add an existing web item (file) or an existing web site?
|
|
|
|
|
An existing web site/service (HTTP).
Our team has been struggling with converting a 2003 project to 2005 and VS just keeps re-org-ing the project. And doesn't play too well with VSS with the websites either!
ed
~"Watch your thoughts; they become your words. Watch your words they become your actions.
Watch your actions; they become your habits. Watch your habits; they become your character.
Watch your character; it becomes your destiny."
-Frank Outlaw.
|
|
|
|
|
Hi there,
Basically, the VS 2003 only allows to create a web project on the IIS, so when you use the VS 2005 to open a 2003 project from VSS, by default it uses the IIS and if it finds out that there is a web site with the similar name which is existing in the current IIS then it suggests a new name by adding the _1 suffix. So here if you are adding a 2003 project, say MyWebApp, then you might want to check if you have this name MyWebApp already in your IIS or not. Also, there are a couple of work-around options that you might want to consider:
+ If you want to add an existing web project from VSS in the VS 2005( use the menu item File/Source Control ), you can create an empty web site in the IIS with the existing name (you can choose whatever location you like for this web site), then you can add it.
+ You can use VSS client to get all source code from VSS to a specified location, then you can configure a virtual directory for this folder in IIS. And in VS 2005, you can add an existing web site from the menu item File|Add, if you don't want to use IIS, then you don't need to confifure the virtual directory, instead you can choose the File System in the Add Existing Web Site dialog box.
|
|
|
|
|
hi there,
I've written my own base class for my aspx pages which derives from System.Web.UI.Page . Everything worked fine but now I needed to do something like this:
public class MyPageBase : System.Web.UI.Page
{
public MyPageBase()
{
if(base.Page.User != null)
{
}
}
}
Of course, the User is likely to not be available in the constructor logic, but eventhough I check for null , I can't open my pages in the designer anymore. It first throws a NullReferenceException into my face and, if that wouldn't be enough, shows me a blank work-area afterwards.
Code is quite complicated, so it's hard to put snippets here. If my question leave open ends, please do not hesitate to ask for further details. I'm really quite pi**ed off about this issue.
thank you very much in advance!
/matthias
I love deadlines. I like the whooshing sound they make as they fly by. [Douglas Adams]
|
|
|
|
|
|
hi there,
thanks for your reply. unfortunately Control.DesignMode is .net 2.0 and I'm still on 1.1
anmore hints or ideas?
/matthias
I love deadlines. I like the whooshing sound they make as they fly by. [Douglas Adams]
|
|
|
|
|
Two options at least come to mind:
+ Use the DesignMode[^] property of the Site[^] object, however be aware that the Site object does not exist at runtime.
+ Check something that only exists at runtime for example the current http context: HttpContext.Current .
|
|
|
|
|
With only one record on my 2nd page in my datagrid, when I go from page 2 to page 1 in my Datagrid (ASP.NET v1.1), I get:
Input string was not in a correct format.
[FormatException: Input string was not in a correct format.]
Microsoft.VisualBasic.CompilerServices.DoubleType.Parse(String Value, NumberFormatInfo NumberFormat) +193
Microsoft.VisualBasic.CompilerServices.IntegerType.FromString(String Value) +92
[InvalidCastException: Cast from string "" to type 'Integer' is not valid.]
Microsoft.VisualBasic.CompilerServices.IntegerType.FromString(String Value) +206
Work_PackageVBConvert_P3E.SARESTableSubform.DataGrid1_DeleteCommand(Object source, DataGridCommandEventArgs e) +185
System.Web.UI.WebControls.DataGrid.OnDeleteCommand(DataGridCommandEventArgs e) +109
System.Web.UI.WebControls.DataGrid.OnBubbleEvent(Object source, EventArgs e) +589
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +26
System.Web.UI.WebControls.DataGridItem.OnBubbleEvent(Object source, EventArgs e) +106
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +26
System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e) +121
System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +115
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +138
System.Web.UI.Page.ProcessRequestMain() +1292
****************************************************************
I have no idea what's going on or why this is happening. If I add another record to my datagrid, and now I have two rows on my second page, I can go to the first page successfully.
The PageIndexChanged routine is simply:
DataGrid1.CurrentPageIndex = e.NewPageIndex
Call DG()
Any ideas?
Thanks!
|
|
|
|
|
AFAIF many people have the similar problem and one of the reasons is the bug in the ASP.NET 1.1, so you may want to search for the Microsoft KB. However, the error stack tells me that the control was deleting something as the DeleteCommand event gets fired ????
|
|
|
|
|
...and that's what I couldn't figure out as far as the DeleteCommand getting fired. When there are two records on the 2nd page, there's no exception thrown when I click the #1 page link. If I delete one record from the 2nd page and now there's only 1 record on that page, the exception get's thrown when I click the link to go to page #1. Why does the DeleteCommand get fired when I click the page #1 link?
I tested my original datagrid, and it doesn't do this...it's works fine. The only difference is the edit item template for this current datagrid where I put two dropdown lists and two text boxes in one column, so the user didn't have to scroll horizontally. The original datagrid, which changes my 4th text box/column to a ddl, and my 6th textbox/column to a ddl doesn't throw any errors. Weird......but at least it's a better UI than before, and I just display a tiny error message.
Thanks!
|
|
|
|
|
I have a website project in visual studio 2005 and I want to apply security using Sessions
is there a simple way to do this???
|
|
|
|
|
I upgrade my site from asp.net 1 to 2.0 and everything work fine on localhost. However, after I upload my website to my host and I got the following message:
Server Error in '/asi_web' Application.
--------------------------------------------------------------------------------
Runtime Error
Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.
Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".
<!-- Web.Config Configuration File -->
<configuration>
<system.web>
<customErrors mode="Off"/>
</system.web>
</configuration>
Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL.
<!-- Web.Config Configuration File -->
<configuration>
<system.web>
<customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
</system.web>
</configuration>
I check my web.config file and the <customErrors mode> is "Off" and I also check to see if my web.config file is valid by copying it to notepad and view it in a browser. Everything looks OK. I also call our host to check if asp.net 2 is installed and they told me it is. Therefore, I am stuck and do not know what to do. Any help would greatly reduce my pressure from my boss.
Rookie Programmer
|
|
|
|
|
Rookie wrote: I check my web.config file and the <customerrors mode=""> is "Off"
It seems like the file is not used at all. Plant a deliberate error in the file to see if you get a configuration error.
---
b { font-weight: normal; }
|
|
|
|
|
Thank you for your help.
I have created an invalid web.config file and still gets the same error. Looks like web.config file is not being read. This is very strange.
Rookie Programmer
|
|
|
|
|
Then you should contact your host and ask where the actual root of the application is.
If your site is not a web application, it's not a proper site. It's just a folder in some other site.
---
b { font-weight: normal; }
|
|
|
|
|
I have an iframe that takes its src from another .aspx page(say, chatmessage.aspx).
Chatmessage.aspx is filled in runtime making its .aspx page increase step by step....
The problem is, when i call this chatmessage.aspx from iframe that resides on another page(say Chatwindow.aspx),
iframe focus is not getting set to last text. i.e. the focus is automatically set to the start of the page in iframe rather than ending of the page.....Can someone help..Urgent!!!!
|
|
|
|
|
I would imagine you have set the focus on chatmessage.aspx... the iFrame simply displays the content of that page.
Could you please explain what form element it is that you are trying to focus on?
Nila
|
|
|
|
|
Place a bookmark at the end of the page and add the bookmark to the URL.
---
b { font-weight: normal; }
|
|
|
|
|
Private Sub DataGrid1_DeleteCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles DataGrid1.DeleteCommand
Dim d As String
d = DataGrid1.DataKeys(e.Item.ItemIndex)
cmd = New SqlCommand("DELETE FROM functional WHERE comp=@comp", con)
cmd.Parameters.Add("@comp", d)
con.Open()
cmd.ExecuteNonQuery()
con.Close()
deletedata()
and
Sub deletedata()
Dim ds As DataSet
Dim strSQL As String = "select FROM functional "
da = New SqlDataAdapter(strSQL, con)
ds = New DataSet
con.Open()
da.Fill(ds, "functional")
con.Close()
DataGrid1.DataSource = ds
DataGrid1.DataMember = "functional"
DataGrid1.DataKeyField = "comp"
DataGrid1.DataBind()
End Sub
what wrong with it
-- modified at 11:40 Thursday 17th August, 2006
omi
|
|
|
|
|
omi98 wrote: what wrong with it
Nah, you need to tell us in details what wrong with it so that we may help you figure out the cause.
|
|
|
|