|
hey
i got it..the text box was outside the grid only..actually i used a html input field and made that field in the grid hidden..iam giving the code here which i used.
and to retrieve the value
txt1.Text = ((HtmlInputHidden)GvPromotion.Rows[e.NewEditIndex].FindControl("DescHiddenValue")).Value;
anyway thanx for sparing your time..
pintoo
|
|
|
|
|
You are Welcome!......
"Save water,It's precious"
|
|
|
|
|
Hi,
I have developed a Windows Contol and now I want to add multi language support so that my control user (the developer) will be able to create a sattelite assembly and place the assembly to appropriate folder in his application. But I can I convert my control so that it can load string from sattelite assembly, moreover, how can I set the option to my control so that the language can be set or automatically set by the operating system ! 0r by the developer (manually). I searched in Google, but I am not getting any easy direction, all articles are talking about either how to create sattelite assembly or how to set different culture. But my problem is realted to Custom Control where I dont have headache of creating sattelite assemblies, rather I want to give the option to my control user to use sattelite assembly/
Please help.
|
|
|
|
|
I have an input class in my XNA game, and I call a method from that class to the main class, to exit the game.
(Basically)
class Game1 : XNA.blah,blah,blah<br />
{<br />
<br />
Input input;<br />
<br />
void Initialize()<br />
{<br />
input = new Input();<br />
}<br />
<br />
void Update(GameTime gameTime)<br />
{<br />
input.CheckInput();<br />
}<br />
}<br />
<br />
public class Input : Game1<br />
{<br />
public void CheckInput()<br />
{<br />
if (Keyboard.GetState().IsKeyDown(Keys.Escape))<br />
{<br />
this.Exit();<br />
}<br />
}<br />
}
*there's more code, but that's not the issue; regualr stuff it starts with
So, how would I make the game exit from a different class? Thanks.
- I love D-flat!
|
|
|
|
|
public class Game1{
private Input mInput;
public Game1(){
mInput = new Input(this);
}
}
public class Input{
private Game1 mGame;
public void CheckInput(){
mGame.Exit();
}
public Input(Game1 game){
mGame = game;
}
}
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
|
|
|
|
|
I am attempting to create a structure that I would like to call sizeof(myStruct) to return 16. However, when I attempt to make this call from code, I get the error,
'myStruct' does not have a predefined size, therefore sizeof can only be used
in an unsafe context (consider using System.Runtime.InteropServices.Marshal.SizeOf) I searched online, and the only note that I found was someone who stated that, because the CLR determines the layout of the structure at runtime, the size of myStruct cannot be determined at compile time. Due to this comment, I thought that I could include the following attribute on my structure to solve this problem:
[StructLayout(LayoutKind.Sequential, Pack = 8, Size = 16)]
public struct myStruct : IEquatable<myStruct>, IComparable<myStruct>, IComparable {
...
} However, this results in the same error. There has to be a way for me to do this, as the built-in types int, float, etc. all allow this method call without throwing an exception. Another issue that I think is related is that I cannot declare a constant of type myStruct. If anyone has some insight into either of these problems, I would appreciate some help. Thanks,
Sounds like somebody's got a case of the Mondays
-Jeff
|
|
|
|
|
So use an unsafe context, big deal.
|
|
|
|
|
Ok, but lets say that I am running it within a web service on a server that I don't control, and the server doesn't allow unsafe code to run?
Sounds like somebody's got a case of the Mondays
-Jeff
|
|
|
|
|
In that case what would you do with sizeof?
|
|
|
|
|
I have a collection that I wrote that has a statement at the top as follows:
using BaseType = SomeStructTypeHere;
...
public class Foo : ... {
...
private const int c_Size = sizeof(SomeStructTypeHere) << 3;
private static readonly int c_Bits = MathExtension.Log2(c_Size);
...
} I did this for maintenence purposes, so I could modify the 'Foo' class as necessary to use one of any number of structures as the base type for the class (changing the base type only changes the hard limits on the class, but NOT its functionality). This class is being used in a web service, and therefore cannot use unsafe code, as I have explained. I would now like to use the 'Foo' class with my type as 'BaseType'. How can I go about doing this? Thanks,
Sounds like somebody's got a case of the Mondays
-Jeff
|
|
|
|
|
Skippums wrote: cannot use unsafe code, as I have explained
Well, no you hadn't.
I think Mark's question still stands... what are you doing with the size?
|
|
|
|
|
PIEBALDconsult wrote:
Well, no you hadn't [stated that you cannot use unsafe code].
In my second post (in response to Mark), I said,
Ok, but lets say that I am running it within a web service on a
server that I don't control, and the server doesn't allow unsafe code to run? Perhaps I made it sound too much like a hypothetical, but it isn't. It the real-world, so unsafe is out of the question. What exactly am I using it for? Well, basically I need to know the size of the structure (call it 'X', in bits) so I can figure out some shift/mask values as follows:
1. I need to be able to shift something by all values < 'X'
for (byte i = X - 1; i >= 0; --i) {
...
long myValue = someValue << i;
...
}
2. I need to use the mask 'X' - 1 to get information from variables
long myValue = someValue & (X - 1);
3. I need to be able to shift something by log2('X')
long myValue = someValue << MathExtension.Log2(X); The previous three examples are riddled throughout my code, and X, Log2(X), and X-1 are all stored in constants within the class. Those constants are populated by making a call to the sizeof() method on the BaseType struct (declaration: "using BaseType = myStruct;"). How can I get this information without using unsafe context? Thanks,
Sounds like somebody's got a case of the Mondays
-Jeff
|
|
|
|
|
We need to know what you are trying to achieve before we can make suggestions. What does this function on the webservice do?
|
|
|
|
|
Iterate the fields and sum their sizes?
Wouldn't you only need the size in an unsafe context anyway?
|
|
|
|
|
Please see my response to Mark for clarification on exactly what I am trying to do. However, iterating over the private members is far too much work for what I am attempting to do. Thanks,
Sounds like somebody's got a case of the Mondays
-Jeff
|
|
|
|
|
say that within each egg carton, the ‘slot’ for each egg is given a number, just like we number arrays. We will also number the egg cartons themselves. So in the picture below, we see that egg carton #0 has 8 slots. Within egg carton #0, the slots are number 0, 1, 2, 3, 4, 5,6, and 7, just like the carton was an array. Another way to number the slots would be to use ‘global slot number’. This is what you’d get, if you started counting at the first slot in the first carton, and then kept counting when you moved on to the second carton, etc, etc. For example, “carton#0, slot#1” would be given the ‘global slot number’ of 1, since you start counting (at carton#0, slot#0) with 0, then count carton#0, slot#1 as ‘global 1’. When you run out space in the first carton (having reached ‘global 7’, at “carton#0, slot#7”), you go on to the second carton, and keep counting. So carton#1, slot#0 is actually ‘global slot number 8’. Carton #1, slot #5 is ‘global slot number 13’, and ‘global slot number 17’ really means carton #2, slot #1.
You need to fill in code, in program that is provided below, so that your program will ask the user for the ‘global slot number’ of a particular slot in a particular egg carton, and will then tell the user which carton, and which slot # with that carton, to put the egg.
|
|
|
|
|
I need to fill in the code?, No i don't. Its not my homework.
Regards,
Gareth.
|
|
|
|
|
Alex501 wrote: your program will ask the user for the ‘global slot number’ of a particular slot in a particular egg carton, and will then tell the user which carton, and which slot # with that carton, to put the egg.
What country is this grocery store in? They don't work like that in the US.
led mike
|
|
|
|
|
Easy. Just limit the number of cartons to 1, and the number of slots in a carton to 1. Then ask for input from user for a global slot number. Reject any input that isn't "1". Then output Carton 1, Slot 1 as your answer.
We violated nature and our children have to pay the penalty
Don't go near the water children... Johnny Cash - 1974
|
|
|
|
|
They don't call you "smart" for nothing.
|
|
|
|
|
When is your homework due? I have five others ahead of you needing "urgent" homework help.
And there is no mention in your help wanted advertisment about how you are going to pay me to do your homework for you.
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Individuality is fine, as long as we do it together - F. Burns
|
|
|
|
|
I'm developing a membership app that allows the user to view information in a highly dynamic way. For instance the user can click through folder like structures, add/edit/move/delete records. Right now I'm saving the data to an Access database and I'm fine with that. My concern is that with the methods I've established, this dynamic interface will require a lot of table creation. I need answers to the following questions:
1. Does excessive amounts of tables slow the performance of an Access db or does only the amount a records slow the performance.
2. Is there a better way to save my data? I am wanting to write the code so it can adapt to a multi-user program.
Thanks a million!
Richard
may your code be error free.
(okay, maybe two lines.)
|
|
|
|
|
programmingAddict wrote: Right now I'm saving the data to an Access database
programmingAddict wrote: so it can adapt to a multi-user program.
I don't believe Access is recommended for multi-user systems. But since your data is highly dynamic that could be a special case. My experience is limited to data that is sort of dynamic.
led mike
|
|
|
|
|
You need to live a little. I've seen data so dynamic that it blurs when you save it to the database.
Of course its a pain to debug because the exceptions can fly right past your eyeballs, and the sonic boom can spilt coffee mugs at ten paces.
I'm terrible at debugging without coffee
|
|
|
|
|
Richard,
I've had a million rows in some Access databases, no problem.
I'm trying to understand why you are creating tables on the fly.
What sort of data are you saving?
Can you define a set number of tables and use your UI to populate those tables?
How many members are we talking about?
modified 27-Feb-21 21:01pm.
|
|
|
|
|