Click here to Skip to main content
15,907,225 members
Home / Discussions / C#
   

C#

 
GeneralRe: form -> database Pin
pawcio_be18-Jan-07 5:49
pawcio_be18-Jan-07 5:49 
GeneralRe: form -> database Pin
V.18-Jan-07 20:38
professionalV.18-Jan-07 20:38 
GeneralRe: form -> database Pin
Eytukan18-Jan-07 20:51
Eytukan18-Jan-07 20:51 
QuestionImage Processing - problem with copying data Pin
Michael O.18-Jan-07 2:51
Michael O.18-Jan-07 2:51 
AnswerRe: Image Processing - problem with copying data Pin
Luc Pattyn18-Jan-07 3:26
sitebuilderLuc Pattyn18-Jan-07 3:26 
Questiontrusted connection Pin
fmardani18-Jan-07 2:48
fmardani18-Jan-07 2:48 
AnswerRe: trusted connection Pin
BlaiseBraye18-Jan-07 2:50
BlaiseBraye18-Jan-07 2:50 
Questionhow to cancel the adding row process in DataGridView? Pin
BlaiseBraye18-Jan-07 2:46
BlaiseBraye18-Jan-07 2:46 
For information I am working with a bindinglist as datasource :
see the objectview project here: http://sourceforge.net/projects/objectviews

OK, i want to be more explicit,
It's really easy to work with them both.

But in my context, I have keys collections.
So I wanted to have an inputBox which would appear when the object bounded contains a key.
Of course this inputBox is asking a unique key for the new object (row...)

The idea is that once the object is created, the user is not allowed to edit the key column (which has been set in read only mode at generation time).

Currently, how am I working?
I have a control which extend the DataGridView and which is composed of an ObjectView
let's call them dgvExt and collection.

in dgvExt i have my implementation to generate columns, to know which are keys,...
in dgvExt I have a EventHandler which listen the collection.RowAdding event.

this event is sending in parameter the innerobject (null at this step) that will be bounded to the row.

so.. In my EventHandler, I am creating my self the new object if it contains keys.
and I set it in the parameter sent by collection.
maybe you will understand why I want to work like this when you'll this code:


void collection_RowAdding(object sender, InstanceEventArgs e)
{

    InputBox ib;
    Type type = typeof(ConfigurationElement);
    if (e.Type.Equals(typeof(KeyValueConfigurationElement)))
    {
        ib = new InputBox("Insert the key", "Insert key");
        if (ib.ShowDialog() == DialogResult.OK)
            e.Instance = new KeyValueConfigurationElement(ib.EnteredText, "");
    }
    if (e.Instance != null && e.Instance is ConfigurationElement)
    {
        MethodInfo init
            = typeof(ConfigurationElement).GetMethod("Init", BindingFlags.NonPublic | BindingFlags.Instance, null, new Type[] { }, null);
        init.Invoke(e.Instance, new object[] { });
    }
}


In fact the problem is not what I want to do here,
but how to cancel the adding process in dgvExt efficiently?
Why to cancel? the inputBox allow the user to cancel... but I don't want a row with empty key...

this problem is really hard for me... certainly I am just not on the right way.


enjoy the code with you is my priority,
Blaise Braye

Questioninform app of changes in database content Pin
zt.Prog18-Jan-07 2:42
zt.Prog18-Jan-07 2:42 
AnswerRe: inform app of changes in database content Pin
BlaiseBraye18-Jan-07 2:48
BlaiseBraye18-Jan-07 2:48 
GeneralRe: inform app of changes in database content Pin
zt.Prog18-Jan-07 3:13
zt.Prog18-Jan-07 3:13 
GeneralRe: inform app of changes in database content Pin
BlaiseBraye18-Jan-07 3:29
BlaiseBraye18-Jan-07 3:29 
AnswerRe: inform app of changes in database content Pin
Rick van Woudenberg18-Jan-07 2:53
Rick van Woudenberg18-Jan-07 2:53 
AnswerRe: SqlTriggerContext? Pin
zt.Prog20-Jan-07 23:40
zt.Prog20-Jan-07 23:40 
Questionweb service Pin
michael_jhons18-Jan-07 2:16
michael_jhons18-Jan-07 2:16 
AnswerRe: web service Pin
Rick van Woudenberg18-Jan-07 2:33
Rick van Woudenberg18-Jan-07 2:33 
Questionlogin Pin
fmardani18-Jan-07 1:56
fmardani18-Jan-07 1:56 
AnswerRe: login Pin
Dustin Metzgar18-Jan-07 3:23
Dustin Metzgar18-Jan-07 3:23 
Questionhow to change text box.text when textbox are disabled. Pin
sumit_kumar18-Jan-07 1:33
sumit_kumar18-Jan-07 1:33 
AnswerRe: how to change text box.text when textbox are disabled. Pin
Christian Graus18-Jan-07 1:47
protectorChristian Graus18-Jan-07 1:47 
GeneralRe: how to change text box.text when textbox are disabled. Pin
Rick van Woudenberg18-Jan-07 2:24
Rick van Woudenberg18-Jan-07 2:24 
GeneralRe: how to change text box.text when textbox are disabled. Pin
V.18-Jan-07 3:33
professionalV.18-Jan-07 3:33 
GeneralRe: how to change text box.text when textbox are disabled. Pin
Christian Graus18-Jan-07 9:21
protectorChristian Graus18-Jan-07 9:21 
QuestionTo write file to other system on LAN Pin
RimiAsh18-Jan-07 1:30
RimiAsh18-Jan-07 1:30 
AnswerRe: To write file to other system on LAN Pin
Dustin Metzgar18-Jan-07 3:28
Dustin Metzgar18-Jan-07 3:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.