Design and CSS styles
Version 5.x > Design and CSS styles > web part Contact List View modes: 
User avatar
Member
Member
cristian.sarda-fsm - 9/25/2012 5:31:29 AM
   
web part Contact List
Is possible modify the web part contact list add the link of Username ?
thanks

User avatar
Kentico Developer
Kentico Developer
kentico_ivanat - 9/25/2012 6:13:48 AM
   
RE:web part Contact List
Hi,

this web part is based on uniselector. If you take a look at the the code of web part, you will find the control which are used. The last one is uniselector. The uniselctore has a property EditItemPageUrl which you can use to create the link. I suggest you to clone web part first and create a copy of all control which are used by this web part.

Best regards,
Ivana Tomanickova

User avatar
Member
Member
cristian.sarda-fsm - 9/25/2012 6:59:36 AM
   
RE:web part Contact List
I cloned the Web Part "contact list" do you have any example to show me?

User avatar
Kentico Developer
Kentico Developer
kentico_ivanat - 9/25/2012 7:06:40 AM
   
RE:web part Contact List
Hi,

if you take a look at the markup of the you will see the path to control which is used on this by this web part. You need create its copy and change path to control in the web part. The same with control which is used in the control. Now you should finally see the uniselector control and its configuration example is in the documentation I sent you in a previous e-mail. So the final step is just to play with configuration properties of uniselector to get requested result.

Best regards,
Ivana Tomanickova

User avatar
Member
Member
cristian.sarda-fsm - 9/25/2012 7:43:04 AM
   
RE:web part Contact List
Thanks I look at the manual you sent me and try, if you can let me pay?

User avatar
Kentico Developer
Kentico Developer
kentico_ivanat - 9/25/2012 7:57:37 AM
   
RE:web part Contact List
Hi,

could you please clarify your the last question? I am not sure if I am following you.

Thank you.

Ivana Tomanickova

User avatar
Member
Member
cristian.sarda-fsm - 10/2/2012 1:00:07 PM
   
RE:web part Contact List
i have tried to do but i can't make it.
can you do it for me , please?
thank you

User avatar
Kentico Developer
Kentico Developer
kentico_ivanat - 10/8/2012 7:21:39 AM
   
RE:web part Contact List
Hi,

1. The first step is to create a copy of web part and controls which are used by this web part.
2. Then you can make following changes in copy of control:
c:\<project>60\CMSModules\Membership\FormControls\Users\SelectUser.ascx.cs

in the metho SetepControls() you need to register following event:
usUsers.OnAdditionalDataBound += new CMSAdminControls_UI_UniSelector_UniSelector.AdditionalDataBoundEventHandler(usUsers_OnAdditionalDataBound);


Then in its implementation call:

 object usUsers_OnAdditionalDataBound(object sender, string sourceName, object parameter, string value)
{
switch (sourceName.ToLowerInvariant())
{
case "itemname":
{
DataRowView drv = (parameter as DataRowView);

// Get item ID
string itemID = drv[ReturnColumnName].ToString();

// Get item name
string itemName = GetItemName(drv.Row);

if (Enabled)
{
val = "<div class=\"SelectableItem\" onclick=\"US_ProcessItem('" + ClientID + "', '" + ValuesSeparator + "', document.getElementById('chk" + checkBoxClass + "_" + ScriptHelper.GetString(itemID).Trim('\'') + "'), true); return false;\">" + HTMLHelper.HTMLEncode(TextHelper.LimitLength(itemName, 100)) + "</div>";
}
else
{
val = "<div>" + HTMLHelper.HTMLEncode(TextHelper.LimitLength(itemName, 100)) + "</div>";
}

break;
}
return "EEE";
}

return value;
}


To see the change replace above method with the below one as a test:

object usUsers_OnAdditionalDataBound(object sender, string sourceName, object parameter, string value)
{
switch (sourceName.ToLowerInvariant())
{
case "itemname":
return "EEE";
}

return value;
}



In the code above you can generate the link to the edit page instead of string "EEE".

Best regards,
Ivana Tomanickova