Solved

What the following Datagrid code will do?

Posted on 2012-03-21
18
270 Views
Last Modified: 2012-03-26
Can anyone explain what the following  code will do?

 
  Dim tc As TemplateColumn
                    tc = New TemplateColumn
                    tc.ItemTemplate = New prj.GridTemplateHandler("ImagePath", "string", "", Me.strServerTimeZone)
                 DataGrid1.Columns.Add(tc)

Open in new window


Does it add any image to the column?  where the image will be picked?
0
Comment
Question by:PeteEngineer
  • 11
  • 6
18 Comments
 
LVL 16

Assisted Solution

by:Easwaran Paramasivam
Easwaran Paramasivam earned 100 total points
ID: 37746826
It creates an ItemTemplate with image.

Look at the method prj.GridTemplateHandler("ImagePath", "string", "", Me.strServerTimeZone). Debug the method to identify where the image is picked from?
0
 
LVL 20

Expert Comment

by:BuggyCoder
ID: 37746829
It is adding a template column into the gird dynamically, the content of the item template depends on the implementation of GridTemplateHandler.

Share the code for the class and then will be able to tell you...
0
 
LVL 8

Author Comment

by:PeteEngineer
ID: 37746839
I have only the dll where this GridTemplateHandler located ..i dont have project ..

But from somewhere a image is picked that i need to findout
0
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
LVL 8

Author Comment

by:PeteEngineer
ID: 37746848
I have right clicked on the method and clicked on "go to definition"

I can see :

Public Class GridTemplateHandler
          Inherits System.Object
     Member of prj
0
 
LVL 20

Expert Comment

by:BuggyCoder
ID: 37746849
Is it picking the same image everytime, what is this DLL, share the signature of class and methods that your are using....
0
 
LVL 8

Author Comment

by:PeteEngineer
ID: 37746853
But i can tell you the value inside tc.ItemTemplate

using break point
0
 
LVL 8

Author Comment

by:PeteEngineer
ID: 37746858
Yes image is same for all the rows in the same column when there is no data ..(ie a blank one not sure its image)..but image is different when there is data .. its comming from a table
0
 
LVL 8

Author Comment

by:PeteEngineer
ID: 37746877
the value inside that or signature of the method has two things only

1.CustomeCurrencyCulture
2. Hidecurrencysymbol
0
 
LVL 20

Expert Comment

by:BuggyCoder
ID: 37746879
well where did you get this dll from, i hope there is some documentation for you to refer.
Other option is Use a dis-assembler like ILDASM and get the IL and see if it can give you some hint.....

Some disassemblers even create c# code from Assembled .Net DLL.
0
 
LVL 8

Author Comment

by:PeteEngineer
ID: 37746904
OK i got it :

When i put "test" instead of "" ..i am getting a "test" instead of image.

  tc.ItemTemplate = New prj.GridTemplateHandler("ImagePath", "string", "test", Me.strServerTimeZone)

So above function using a parameter of image location at the place of "test"

right now my problem is when i get i give a blank as this function parameter ..instead of showing blank in the rows of that column..its showing an error message ..i will post that error in the next post
0
 
LVL 8

Author Comment

by:PeteEngineer
ID: 37746951
"Image path is neither a datacolumn or a datarelation for table Table"

Why the above message is comming instead of blank rows in that column?
0
 
LVL 20

Assisted Solution

by:BuggyCoder
BuggyCoder earned 400 total points
ID: 37746978
Maybe this method is implemented in such a way that if image parameter is null or empty, it will return an exception.

something like:-

if(string.IsNullOrEmpty(val))
{
throw new InvalidOperationException("This parameter cannot be empty");
}
0
 
LVL 8

Author Comment

by:PeteEngineer
ID: 37747050
Where i need to put the above code?

I need to make blanks in the rows ..how the above code help me in making it ?
0
 
LVL 20

Expert Comment

by:BuggyCoder
ID: 37747058
No Where, i was just telling you that this might be the code in the method in your dll because of which it throws error
0
 
LVL 8

Accepted Solution

by:
PeteEngineer earned 0 total points
ID: 37747096
Alright i am gonna do this , may be this be a solution:  

 tc.ItemTemplate = New prj.GridTemplateHandler("ImagePath", "string", " ", Me.strServerTimeZone)


An extra space for double quotations
0
 
LVL 8

Author Comment

by:PeteEngineer
ID: 37747107
Alright it fixed the issue ,,, so thanks for helping ...Yipieeeeeeee!!
0
 
LVL 20

Expert Comment

by:BuggyCoder
ID: 37747114
Please rate and close this question.

Happy programming
:-)
0
 
LVL 8

Author Closing Comment

by:PeteEngineer
ID: 37764917
Thanks!
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question