This is a migrated thread and some comments may be shown as answers.

ImageColumn Click For Filtering FAILS

8 Answers 128 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Bimar
Top achievements
Rank 1
Bimar asked on 09 Jun 2008, 09:20 AM
Hi All;

When i click a filtering texbox of an imageColumn a have an exception. what am i supposed to do?

if you tell the way  to close "all filtering stuff" of image columns. It's o.k too.

Thanks You

the exception:
Value cannot be null.
Parameter name: key
at System.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument)
   at System.Collections.Generic.Dictionary`2.FindEntry(TKey key)
   at System.Collections.Generic.Dictionary`2.TryGetValue(TKey key, TValue& value)
   at Telerik.WinControls.UI.GridViewEditManager.GetDefaultEditor(IEditorProvider provider)
   at Telerik.WinControls.UI.BaseGridBehavior.InitializeEditor(GridViewColumn column)
   at Telerik.WinControls.UI.BaseGridBehavior.OnMouseDownLeft(MouseEventArgs e)
   at Telerik.WinControls.UI.BaseGridBehavior.OnMouseDown(MouseEventArgs e)
   at Telerik.WinControls.UI.RadGridView.OnMouseDown(MouseEventArgs e)
   at System.Windows.Forms.Control.WmMouseDown(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at Telerik.WinControls.RadControl.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)

8 Answers, 1 is accepted

Sort by
0
Martin Vasilev
Telerik team
answered on 09 Jun 2008, 04:09 PM
Hello Yesim Ozuzeybek,

Thank you for writing.

In the last release of RadGridView in Q1 2008, you cannot modify the filter value if the column is an ImageColumn. In the older version, you could set the filter text editor to ReadOnly to prevent typing. Please review the code-block below as example:

((RadTextBoxItem)grid.MasterGridViewInfo.TableFilteringRow.Cells["Picture"].CellElement.Children[1]).ReadOnly = true

I hope this helps. If you have other questions, do not hesitate to contact me again.

Sincerely yours,
Martin Vasilev
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Bimar
Top achievements
Rank 1
answered on 10 Jun 2008, 06:40 AM
Hello Martin.

Thanks for your quick response..

Let me explain my situation. I dont want to set the filter or doing anything about filtering for  the image columns.  But you cant prevent users clicking the filtering text box of a image cloumn in the filtering row. And when it's so, it leads an exception.

I'm using Q1 2008.  The code you sent to me is causing a run time error. 

Sincerely yours,
Yesim

Code((RadTextBoxItem)HavuzGridView.MasterGridViewInfo.TableFilteringRow.Cells["LogImage"].CellElement.Children[1]).ReadOnly=true
ErrorIndex Out Of Range
Parameter name: index

Code((RadTextBoxItem)HavuzGridView.MasterGridViewInfo.TableFilteringRow.Cells["LogImage"].CellElement.Children[0]).ReadOnly=true
Error ((RadTextBoxItem)HavuzGridView.MasterGridViewInfo.TableFilteringRow.Cells["LogImage"].CellElement.Children[0]).ReadOnly Cannot cast 'HavuzGridView.MasterGridViewInfo.TableFilteringRow.Cells["LogImage"].CellElement.Children[0]' (which has an actual type of 'Telerik.WinControls.UI.GridFilterCellElement.FilterFunctionButton') to 'Telerik.WinControls.UI.RadTextBoxItem' bool
0
Martin Vasilev
Telerik team
answered on 12 Jun 2008, 07:25 AM
Hi Yesim Ozuzeybek,

Thank you for the additional details.

Actually, in the latest release, Q1 2008 Service Pack 1, the issue with ImageColumn filtering has been addressed. By default, it is not possible to enter a value in the filter editor for an Image column. The code provided in my last post is for versions of our product older than Q1 2008. The exception you see is due to the fact the filtering system has been changed in the new version.

I recommend upgrading to the latest version - Q1 2008 Service Pack 1. It contains many other fixes and improvements too.

I hope this helps. If you have other questions, do not hesitate to contact me again.

Regards,
Martin Vasilev
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Bimar
Top achievements
Rank 1
answered on 13 Jun 2008, 12:09 PM
Hello Martin.

I have already upgraded to Q8 SP1. It still have exception. Would you mind testing same condition in one of your application, one more time. Because if it's really solved in SP1, i have nothing to do to fix it. 

thank you for your support

Yesim
0
Martin Vasilev
Telerik team
answered on 16 Jun 2008, 11:36 AM
Hello Yesim Ozuzeybek,

Thank you for getting back to me.

I have tested RadGridView Q1 2008 Service Pack 1 and I confirm that if the images come from a database and the columns are generated automatically, it is not possible to change the value of the filter editor. It is in disabled state, but only for the image column.

Please provide me with more details about your scenario to allow me to perform additional testing.
Could you make sure that all Telerik assemblies in the Global Assembly Cache (except for the Telerik.Charting assembly) bear the version of 6.1.0.0. Please also make sure your project references the latest assemblies.

If you have the above two conditions fulfilled, and the issue still persists, please open a support ticket and send us your application to allow us to reproduce the issue locally. This wil enable us to resolve any issue much faster and provide much more accurate assistance.

I am looking forward to your response.

Regards,
Martin Vasilev
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Bimar
Top achievements
Rank 1
answered on 20 Jun 2008, 02:53 PM
Hi Martin..

I have checked both  Telerik assemblies in the Global Assembly Cache and project references. They are updated.

i cant send you the application right now, but i can provide extra information about my condition.

the image coloumns that i have problem with,  don't come from a datasource like other data coloumns in my application.. I manually add the image coloumns and manually bind with and image, depends on another field in the same row.

private

void HavuzGridView_CellFormatting(object sender, CellFormattingEventArgs e){if (e.CellElement.ColumnInfo is GridViewImageColumn){
string fieldName = ((GridViewImageColumn)e.CellElement.ColumnInfo).FieldName;
switch (fieldName)
{
case "NotGirisi":
{
if ((bool)e.CellElement.RowInfo.Cells["NotGirisiYapildi"].Value == true)e.CellElement.Image =global::CorrectionIhracatClient.Properties.Resources.buton_fileedit;


perhaps, You may produce the exception if you can provide the condition above..

Thanks again..

Yesim
0
Martin Vasilev
Telerik team
answered on 23 Jun 2008, 03:00 PM
Hello Yesim,

Thank you for additional details.

I have tried the same scenario as you have described, but again, for a manually added image column, the filter editor is disabled. I suppose the specific scenario in your project is causing this issue. Please send me a small application that demonstrates the issue. It will help me reproduce it locally and provide you with further assistance.

I am looking forward to your response.

Sincerely yours,
Martin Vasilev
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Bimar
Top achievements
Rank 1
answered on 16 Jul 2008, 07:45 AM
Hi Martin;

I've sent the example project that i get the exception. 

My ticket ID is : 150102 

i'm looking forward to your response

Tags
GridView
Asked by
Bimar
Top achievements
Rank 1
Answers by
Martin Vasilev
Telerik team
Bimar
Top achievements
Rank 1
Share this question
or