|
"without this text selection"
I don't want any text selection to occur when I select cells on my DataGrid.
|
|
|
|
|
Change SelectionMode to FullRowSelect
Now when the user selects a row, the entire thing is highlighted. They are unable to select the text of individual cells.
Pualee
|
|
|
|
|
The DataGrid doesn't have a SelectionMode property.
|
|
|
|
|
Sorry, I must not have read closely.
Is there any reason you are using the DataGrid instead of the DataGridView? I know there are a lot of enhancements made, but am unfamilar with anything pre 2.0 Framework at this time.
Pualee
|
|
|
|
|
Well I have Visual Studio 2003 and I work with Framework 1.1. Is there an easy way of using Framework 2.0 without buying VS 2005?
Thank you!
|
|
|
|
|
Did you try the method I put in the reply below using the event? I would suggest researching further using the DataGrid if you are in 2003, but if you are interested in framework 2.0 ...
I think the download for the framework is free so you could always build everything programatically using a text editor. Since you likely won't want to do that you could try the Visual C# 2005 Express Edition which is free, but has a few limitations. Finally, you could try downloading the 2.0 framework and using it with the 2003 IDE, but I do not know what side effects you would see there.
If you are using 1.1, I assume your clients are expected to have 1.1 installed as well. If you change to 2.0, you would also change your runtime requirements for your clients, which I am not sure you want to do. Also, I have no idea what the licensing requirements will be if you ever plan to deploy your application.
Pualee
|
|
|
|
|
Looking briefly, I don't see a similar property on the DataGrid. Maybe someone else could help you there. However, you could try the following to get a similar effect:
Override the SelectedIndexChanged event so that it sets the index on the row selected (overriding the cell selection) with the SelectedIndex property. As a disclaimer, I really don't know if this would unselect the cell.
Pualee
|
|
|
|
|
Hi there,
I am using .NET 2.0 with C#.
I have a master page that I use across a couple of pages. Every web pages that uses this master page will have a different title, and maybe different meta key words and meta descriptions, etc.
I found a way of changing this, but I am not sure if this is the best way to do it??
In the code behind of my master page, I have various properties to set the page header, meta key words, meta description, meta identifier URL, meta robots, meta content language, and meta distribution. I have only included the properties of the page header and meta keys words, the rest works on the same principle:
// Properties (partial)
public HtmlHead PageHeader
{
get { return (HtmlHead)Page.Header; }
}
public string MetaKeywords
{
set
{
HtmlMeta keywords = new HtmlMeta();
keywords.Name = "keywords";
keywords.Content = value;
PageHeader.Controls.AddAt(2, keywords);
}
}
Lets say I have a default.aspx that uses this master page, then I would declare <%@ MasterType VirtualPath="~/App_MasterPages/AppMaster.master" %> at the top of the .aspx file. And then in the default.aspx.cx code behind file I would have the following partial piece of code in a method that sets the title and meta key words (called from Page_Load):
// Add the page title to the header element
Page.Title = "MyWebsite | Welcome";
// Add meta elements to the header element
Master.MetaKeywords = "keyword 1, keyword 2, keyword3";
Is there another way of doing this??
Please can someone advise me?
Regards
ma se
|
|
|
|
|
Maybe the guys from the ASP .NET forum...
|
|
|
|
|
I write a program of find next and highlight it just like in word document. This task can be done using string function.
Anyone tell me about these string function .What are its name and how many parameter they can take
life is so sweet
|
|
|
|
|
sweetcapri wrote: Anyone tell me about these string function .What are its name and how many parameter they can take
Yes. I can answer that question.
It is called IndexOf[^] and it takes 2 parameters.
|
|
|
|
|
Hi there,
I am using .NET 2.0 with C#.
When I create a new master page, the following namespaces are added automatically:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
And then the other necessary code:
public partial class App_MasterPages_Website : System.Web.UI.MasterPage
{
protected void Page_Load(object sender, EventArgs e)
{
}
}
Are all those namespaces required?? What would be best, to remove them all except using System; and add just the necessary namepaces as what I need them?? I see the same namespaces are included when I add a new web page.
The reason why I am asking is because I want to keep my code as clean as possible.
Please can someone advise me?
Regards
ma se
|
|
|
|
|
ma se wrote: Are all those namespaces required??
No.
ma se wrote: What would be best, to remove them all except using System; and add just the necessary namepaces as what I need them??
Sounds like a good plan.
ma se wrote: The reason why I am asking is because I want to keep my code as clean as possible.
Please can someone advise me?
Yes. Keep your code as clean as possible.
|
|
|
|
|
|
It's a matter of taste. Most of them are not required, but a using statement doesn't add anything to the generated code, so they don't do any harm either.
Actually none of them are strictly required, so you can remove all of them if you like, but then you have to specify the namespace for all classes that you use, like for example System.EventArgs.
I usually remove the ones I rarely use and leave the ones that I regularly use, and end up with:
using System;<br />
using System.Collections.Generic;<br />
using System.Web;<br />
using System.Web.UI;<br />
using System.Web.UI.WebControls;<br />
using System.Web.UI.HtmlControls;
---
single minded; short sighted; long gone;
|
|
|
|
|
|
Hi Guffa,
When you say the using statement doesn't add anything to the generated code, then what does it do? Is it just a reference?
Regards
ma se
|
|
|
|
|
It's not even a reference. It's just a declaration that you want to be able to access the members of the namespace directly, without having to specify the full namespace.
The using statement requires that there is a reference to the dll that contains the namespace, but the statement itself only makes the namespace avialable.
---
single minded; short sighted; long gone;
|
|
|
|
|
Hi there,
I am using .NET 2.0 with C#.
I have a website project. I also have a master page in the root directory called Website.master. In the “code behind” of this master file I have the following namespace MyNamespace.Master. When I view the object browser I don’t see this namespace there. Why is this?? Visual Studio only seems to add the namespaces that are in the Bin and App_Code folders. I don’t know if I’m not viewing it correctly, but I can not see it there.
Please can some one help me?
Regards
ma se
|
|
|
|
|
I wanna know how to add an item to a combobox from a textbox by clicking a button.
I usually use C# so i'd prefer to finish what i'm doing in C#.
thanx.
|
|
|
|
|
Try something like:
comboBox1.Items.Add(textBox1.Text);
|
|
|
|
|
|
that worked but when i open the program i add an item, if i restart the program the new item isn't there anymore...
|
|
|
|
|
There may be other ways, but here's what I would do:
- Create a Serializable class with an array of strings as a member.
- When you close your application, create an instance of this class and copy your comboBox items into the string array of your class.
- Then, serialize your class in to file.
Finally, when you start your application, deserialize your class, and use
comboBox1.Items.Clear();<br />
comboBox1.Items.AddRange(myCustomClassInstance.StringArray);
You will find plenty of information and tutorials about serialization on the web.
Cheers
|
|
|
|
|
Won't
myNiftyComboBox.Items.Add(myVerySpecialTextBox.Text);
do the trick?
Regards,
Matt
It isn't enough to do well in life.
One must do good when and where one can.
Otherwise, what's the point?
|
|
|
|