joeharrison714 / MVCGrid.Net

http://mvcgrid.net
MIT License
75 stars 56 forks source link

Is this a joke? #194

Open chicane-S54 opened 4 years ago

chicane-S54 commented 4 years ago

I have the MVCGrid setup EXACTLY like your demos and I get the following ERROR: 'There is already a grid definition with the name 'LogGrid'. Parameter name: name'.

jsuske1985 commented 4 years ago

Do a try and catch:

try
            {
                MVCGridDefinitionTable.GetDefinition<MyClass>("LogGrid");
            }
            catch (Exception e)
            {
                MVCGridDefinitionTable.Add("LogGrid", def);
            }

The reason you are getting that error is because the grid is already defined, doing the try and catch is trying to get an existing form and if it cant it will define a new one.